To execute the precompiled TPTAPI applications available in the \sample\runsamp directory:
- Open a Windows command prompt.
- Change your working directory to <TPTAPI install directory>\sample\runsamp.
- Run the executable that is available in this directory.
For example, to run a 32-bit TPTAPI application built with VC 11.0, issue the following command at the Windows command prompt:
runsamp_vc11_WIN_32.exe tdpid userid password
The following are the steps for accessing Windows code samples:
After you install Teradata PT API, you should see the following directory structure:
\..\bin (contains .lib and .dll files for vc11) \tptapi \inc (contains .h files) \sample \blockloading (Shows how to load rows in buffer mode with the load driver) \checkpoint (Shows how checkpoint/restart works with the stream driver) \common (Contains shared files used by all samples) \generic (Shows how each driver works) \getbuffer (Shows how to export the driver's GetBuffer feature) \inc (Contains shared .h files used by all samples) \multiple (Shows how to use multiple drivers in the same application) \multi_node (Shows how to use the multi-node protocol) \threads (Shows how to write multi-threaded applications) \runsamp (Contains precompiled TPTAPI applications compatible for Windows platforms) \runsamp_vc11_WIN_32.exe (32 bit TPTAPI application built with VC11) \runsamp_vc11_WIN_64.exe (64 bit TPTAPI application built with VC11)The 64-bit .lib and .dll files will only be in the 64-bit Windows package, and the 32-bit .lib and .dll files will only be in the 32-bit Windows package.
- Become familiar with the Teradata PT methods in the sample programs (.cpp files).
In each sample solution file, you can see the following settings.
Build both 32-bit and 64-bit samples in Visual Studio V11.
C/C++ Additional Include Directories:
Linker Additional Library Directories
..\..\..\..\bin\TELAPI.lib (samples(compiled with MSVCvc11))
Edit the makefile and modify the values of the C++C and CC variables to the location of the compilers on your system.
Put the sample executable, data file, and all Teradata PT API dlls in the same directory or specify the Teradata PT API directory in the PATH environment variable.
For example, the following directories should be appended to the PATH environment variable if they are not already there:
C:\Program Files\Teradata\Client\17.00\bin(for TPTAPI library(compiled with MSVCvc11)))All 32-bit executables run with 32-bit dlls and all 64-bit executables run with 64-bit dlls.
- Change the database system name, user name, and user password in the BTEQ scripts setupTables.bteq and cleanupTables.bteq for each sample.
- Run the BTEQ script setupTables.bteq to set up the tables for the current sample.
- Execute the sample.
- Run the BTEQ script cleanupTables.bteq to clean up the tables used by the current sample.