FastExport/OUTMOD Routine Interface - FastExport

Teradata® FastExport Reference

Product
FastExport
Release Number
16.20
Published
September 2020
Language
English (United States)
Last Update
2020-09-11
dita:mapPath
lki1527114222329.ditamap
dita:ditavalPath
obe1474387269547.ditaval
dita:id
B035-2410
lifecycle
previous
Product Category
Teradata Tools and Utilities

FastExport exchanges information with an OUTMOD routine by using the conventional parameter register to point to a six-value OUTMOD interface parameter list as described in the following sections.

Entry Code

Entry code is one of six values that defines the reason for the call. The following table describes the entry code values in 4-byte integer format. The values can be set as described in the table.

FastExport-to-OUTMOD Interface Entry Codes 
Code Specifies
1 Initial Entry – Specifies the initial entry call that FastExport makes before sending the first SELECT statement to Teradata Database.
2 End of Response Entry – Specifies the end of response call that FastExport makes after receiving the last row of export data from Teradata Database.
3 Response Row Entry – Specifies a response row call that FastExport makes for each row of export data from Teradata Database.
4 Checkpoint Entry – Specifies a checkpoint call that FastExport makes after processing the last response row for each SELECT statement.

This call signifies that the OUTMOD routine should capture checkpoint data to support a restart operation if Teradata Database or client system fails.

5 Teradata Database Restart Entry – Specifies the first call that resumes processing after a Teradata Database restart.

If FastExport was writing to an output file when Teradata Database failed, then the utility repositions that file before calling the OUTMOD routine. This call signifies that the OUTMOD routine should also reposition its data or files as needed and execute checkpoint procedures to resume processing.

If the database restarts before the first checkpoint, entry code 2 is sent for cleanup, and entry code 1 is sent to re-initialize the job.

6 Client Restart Entry – Specifies the first call that resumes processing after a client system restart.

If FastExport was writing to an output file when the client system failed, then the utility repositions that file before calling the OUTMOD routine. This call signifies that the OUTMOD routine should also reposition its data or files as needed and execute checkpoint procedures to resume processing.

If the client system restarts before the first checkpoint, entry code 1 is sent to re-initialize the job.

Statement Number

Statement number specifies the relative statement number of the referenced SELECT statement – the first SELECT statement of the FastExport job being statement number 1.

This value is always 1 if the job has only one SELECT statement. The statement number is in 4-byte integer format.

Input Data Length

Input data length specifies the length of the row data, in bytes, for a response row call.

If the OUTMOD routine requires FastExport to write the current response row data to the output file, then the OUTMOD routine should reset this value to 0 before returning to the utility.

The input data length is in 4-byte integer format.

Input Data Record

Input data record specifies the buffer of the actual response row data from Teradata Database.

Output Data Length

Output data length specifies the length of the output data record. On entry to the OUTMOD routine, this parameter has a zero value and the output data record parameter points to an empty buffer. If the OUTMOD routine modifies an input data record, and the new length is:

  • Less than or equal to the input length, the response row can be modified in place. In this case, the OUTMOD routine should set the input data length buffer to the new value before returning to FastExport.
  • Greater than the input length, the output response row must be generated in the output data buffer. In this case, the OUTMOD routine should set the output data length buffer to the new value and reset the input data length buffer to zero before returning to FastExport.

The output data length is in 4-byte integer format.

To prevent data corruption, OUTMOD routines that cannot comply with these protocols should terminate if they encounter a restart code 4, 5, or 6. To support proper FastExport restart operations, OUTMOD routines must save and restore checkpoint information as described here. If the OUTMOD saves checkpoint information in some other manner, a subsequent restart/recovery operation could result in data loss or corruption.