Code Sample - Access Module

Teradata Tools and Utilities Access Module Reference

Product
Access Module
Release Number
15.00
Language
English (United States)
Last Update
2018-09-27
dita:id
B035-2425
lifecycle
previous
Product Category
Teradata Tools and Utilities

Code Sample

Following is an example of an initialization function of the OptParms parameter for a load job.

PIDMMain(pmiCmdBlock_t*opts, void*optParms)		
 
//Initialization Function
opts.Reqtype = pmiPIDMOptInit;		
 
strcpy (optParms.EyeCatcher, pmiEC_Init_t);										 //struct eyecatch string
 
//Pass initialization string to access module
strcpy (optParms.InitStr, InitStr);		 
 
optParms.InitStrL = strlen(optParms.InitStr);  //Length of InitStr
optParms.StructLength=sizeof(optParms);        //Total structure length
optParms.InterfaceVerNo=pmiInterfaceVersionD;  //Header version number of pmdcomt.h
optParms.InterfaceVerNoD=pmInterfaceVersion; 			  //Header version number of pmddamt.h
 
//File Read Function
opts.Reqtype=pmiPIDMOptRead;
strcpy(optParms.EyeCatcher, pmiEC_RW_t);     //Stuct eyecatcher string
 
//Pointer to a buffer into which the access module is to return the data block
optParms.Buffer=(char*)malloc(1024);
 
optParms.bufferLen=1024
optParms.StructLength=sizeof(optParms);     //Total structure length