Windows - Parallel Transporter

Teradata Parallel Transporter Application Programming Interface Programmer Guide

Product
Parallel Transporter
Release Number
16.10
Published
May 2017
Language
English (United States)
Last Update
2018-05-15
dita:mapPath
pev1488824663354.ditamap
dita:ditavalPath
Audience_PDF_include.ditaval
dita:id
B035-2516
lifecycle
previous
Product Category
Teradata Tools and Utilities

To execute TPTAPI samples using VS2005 (vc8), copy libraries from the /bin/vc8 folder to /bin.

To execute the precompiled TPTAPI applications available in \sample\runsamp directory:

  1. Open a Windows command prompt.
  2. Change your working directory to <TPTAPI install directory>\sample\runsamp.
  3. Run the executable that is available in this directory.

    For example, to run a 32-bit TPTAPI application built with VC 8.0, issue the following command at the windows command prompt:

    runsamp_vc8_WIN_32.exe  tdpid   userid   password

The following are the steps for accessing Windows code samples:

  1. After you install Teradata PT API, you should see the following directory structure:
    \..\bin (contains .lib and .dll files for vc11)
    \..\bin\vc8 (contains .lib and .dll files for vc8)
    \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_vc8_WIN_32.exe (32 bit TPTAPI application built with VC8.0)
           \runsamp_vc8_WIN_64.exe (64 bit TPTAPI application built with VC8.0)
           \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.
  2. Become familiar with the Teradata PT methods in the sample programs (.cpp files).
  3. In each sample solution file, you can see the following settings.

    Build both 32-bit and 64-bit samples in Visual Studio V8.0 or V11.

    • C/C++ Additional Include Directories:

      	..\inc;.\inc;..\common
    • Linker Additional Library Directories

      ..\..\..\..\bin\TELAPI.lib (samples(compiled with MSVCvc11))
      ..\..\..\..\bin\vc8\TELAPI.lib (samples(compiled with MSVCvc8))

      Edit the makefile and modify the values of the C++C and CC variables to the location of the compilers on your system.

  4. 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\16.10\bin(for TPTAPI library(compiled with MSVCvc11)))
    C:\Program Files\Teradata\Client\16.10\bin\vc8 (for
    TPTAPI library(compiled with MSVCvc8)))
    All 32-bit executables run with 32-bit dlls and all 64-bit executables run with 64-bit dlls.
  5. Change the DBS machine name, DBS user name, and DBS user password in the BTEQ scripts setupTables.bteq and cleanupTables.bteq for each sample.
  6. Run the BTEQ script setupTables.bteq to set up the tables for the current sample.
  7. Execute the sample.
  8. Run the BTEQ script cleanupTables.bteq to clean up the tables used by the current sample.