25.09.2015 Views

Teradata Parallel Data Pump

Teradata Parallel Data Pump Reference - Teradata Developer ...

Teradata Parallel Data Pump Reference - Teradata Developer ...

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Appendix C: INMOD and Notify Exit Routine Examples<br />

C INMOD - UNIX<br />

Int16 len;<br />

char param[80];<br />

} inmodpty;<br />

static int count=0;<br />

char *memcpy();<br />

static int readrecord(inmodbuf *);<br />

#ifdef<br />

WIN32<br />

__declspec(dllexport) void _dynamn<br />

(a,b)<br />

inmodbuf *a;<br />

inmodpty *b;<br />

#else<br />

void _dynamn(a,b)<br />

inmodbuf *a;<br />

inmodpty *b;<br />

#endif<br />

{int code=0;<br />

/*printf("BEGIN--> %d %d %s\n",a->code,a->len,tempbuf); */<br />

/*printf(" +++ %d %d %s\n",b->seq ,b->len,b->param); */<br />

code= (int) a->code;<br />

switch (code) {<br />

case 0:<br />

/* Here you open the file and read the first record */<br />

/* printf("## CODE=0, openinig...\n"); */<br />

count = 0;<br />

if (! readrecord(a))<br />

printf("Messed up in open.\n");<br />

break;<br />

case 1:<br />

/* Utility requested next record, read it */<br />

/* printf("## CODE=1, reading...\n"); */<br />

if (! readrecord(a))<br />

printf("Messed up in read.\n");<br />

break;<br />

case 5:<br />

/* Utility is closing INMOD routine */<br />

a->code=0;<br />

a->len=0;<br />

/* printf("## CODE=5, terminating...\n"); */<br />

break;<br />

default:<br />

a->code=12; /* any number not = to zero */<br />

a->len=0;<br />

printf("##### UNKNOWN code ######\n");a->code=0;a->len=0;<br />

};<br />

/*printf("END --> %d %d %s\n",a->code,a->len,tempbuf); */<br />

/*printf(" +++ %d %d %s\n",b->seq ,b->len,b->param);*/<br />

}<br />

static int readrecord(a)<br />

inmodbuf *a;<br />

<strong>Teradata</strong> <strong>Parallel</strong> <strong>Data</strong> <strong>Pump</strong> Reference 249

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!