Code Sample - Access Module

Teradata® Tools and Utilities Access Module Reference

Product
Access Module
Release Number
17.10
Published
October 2021
Language
English (United States)
Last Update
2021-11-02
dita:mapPath
uur1608578381725.ditamap
dita:ditavalPath
obe1474387269547.ditaval
dita:id
B035-2425
lifecycle
previous
Product Category
Teradata Tools and Utilities

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