Teradata Parallel Data Pump
Teradata Parallel Data Pump Reference - Teradata Developer ...
Teradata Parallel Data Pump Reference - Teradata Developer ...
- No tags were found...
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
Chapter 2: Using <strong>Teradata</strong> T<strong>Pump</strong><br />
Program Considerations<br />
Zip_Code CHAR(5)<br />
Balance DECIMAL(9,2) FORMAT '-$,$$$,$$$.99' )<br />
Unique primary Index (Account_Number);<br />
and then check the system variable &SYSRC for a return code to verify if the table already<br />
exists, a file containing options to continue or quit is logged at the console. Any other error<br />
return codes terminate the job with a <strong>Teradata</strong> <strong>Data</strong>base error, as follows:<br />
.SET CREATERC TO &SYSRC;<br />
.IF CREATERC = 3803 /* Table &TABLE already exists */<br />
.RUN FILE RUN01;<br />
.ELSE<br />
.IF CREATERC 0 THEN<br />
.LOGOFF CREATRC;<br />
.ENDIF<br />
.BEGIN LOAD ----------; /* No errors returned. We can start the job.*/<br />
/* T<strong>Pump</strong> statements go here..... */<br />
.END LOAD;<br />
.LOGOFF;<br />
File RUN01, which operates when the 3803 error causes the RUN FILE command to execute,<br />
contains the following options:<br />
.DISPLAY '&SYSUSER: Table FOO already exists....'<br />
to FILE console;<br />
.DISPLAY '&SYSUSER: Reply Continue anyway...'<br />
to FILE console;<br />
.DISPLAY '&SYSUSER: Reply Abort this JOB....'<br />
to FILE console;<br />
.DISPLAY '&SYSUSER: Reply or .Default '<br />
to FILE console;<br />
.ACCEPT RESPONSE FROM FILE CONSOLE;<br />
.IF RESPONSE 'C' THEN<br />
.LOGOFF CREATERC; /* Quit before we cause trouble */<br />
.ENDIF;<br />
Row Count Variables<br />
The row count variables, which are updated for each <strong>Teradata</strong> T<strong>Pump</strong> task, allow the insert,<br />
update, and delete row counts and the error table counts for each import to be queried:<br />
• &SYSDELCNT[n]<br />
• &SYSETCNT[n]<br />
• &SYSINSCNT[n]<br />
• &SYSUPDCNT[n]<br />
The values are stored in the <strong>Teradata</strong> T<strong>Pump</strong> utility restart log table and are restored after a<br />
client system or <strong>Teradata</strong> <strong>Data</strong>base restart.<br />
When EXECUTE INSERT|UPDATE|DELETE is used, <strong>Teradata</strong> T<strong>Pump</strong> must<br />
rely on the user to have correctly identified the action (INSERT, UPDATE, or DELETE) which<br />
the macro performs. <strong>Teradata</strong> T<strong>Pump</strong> cannot always determine the number of target tables,<br />
and therefore can only provide a single combined value for all target tables. Using the existing<br />
facility of variable substitution, each new system variable can be referenced as soon as the<br />
variable is defined. The new variables are defined during the import phase and should be<br />
<strong>Teradata</strong> <strong>Parallel</strong> <strong>Data</strong> <strong>Pump</strong> Reference 61