Rate Code Example - 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

Add the following code to your application anytime after the Stream driver has initiated and before it has terminated.

             char *dataptr1;
             TD_Length datalen1;
             int queryStatus1 = 0;
             TD_Index index = 0;
             char rate[10];
             int pdcty;
             cout << "Enter RATE : " << endl;
             cin >> rate;
             cout << "Enter PERIODICITY : " << endl;
             cin >> pdcty;
             dataptr1 = (char*)malloc(96);
             memset(dataptr1, 0, sizeof(dataptr1));
             sprintf(dataptr1, "RATE = %s,PERIODICITY = %d", rate,pdcty);
             datalen1=9*sizeof(dataptr1);

             queryStatus1 = conn -> PutEvent(TD_Evt_UserCommand, 
             dataptr1, datalen1, index);

             cout << "\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%" << endl;
             cout << "             RATE INFO                   " << endl;
             cout << "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%" << endl;

             if ( queryStatus1 < TD_Error && queryStatus1 !=              TD_Unavailable )
             {
             cout << "New Values: " << dataptr1 << endl;
             cout << "New Length: " << datalen1 << endl;
             }
             else
             {
             printf("TD_Evt_UserCommand event failed with status = %d",              queryStatus1);
}