16.20 - DBCHCL FET Function - Teradata Tools and Utilities

Teradata® Call-Level Interface Version 2 Reference for Mainframe-Attached Systems

Teradata Tools and Utilities
September 2019
Programming Reference


FET (Fetch) delivers a pointer to the next parcel of the response.

Usage Notes

  • If Return Code is 0, the application may process the response from the Teradata Database. FET may be invoked repeatedly until the entire response has been processed.
  • For Two-phase commit sessions, Fetch ensures that the current session is aborted at syncpoint if a failure parcel is received in response to a request.
  • In addition, the first FET after a CON call will return the following fields:
    • Output-TDP-path
    • Output-TDP-session-number
    • Output-host-id

DBCAREA Input Fields

Before using the Fetch function, the application must set the DBCAREA fields in the first table and may optionally set those in the second table depending on the application's requirements.

DBCAREA Input Fields Required for the Fetch Function
Function Input-CLIv2-connection-number
DBCAREA Input Fields Optional for the Fetch Function
Fetch-data-pointer Fetch-maximum-data-length
Message-area-length Message-area-pointer
Positioning-action Positioning-statement-number
Positioning-value Row-count

DBCAREA Output Fields

Upon completion of the Fetch function, CLIv2 will always set DBCAREA fields in the first table and will set those in the second table if the function was successful.

DBCAREA Output Fields always set by the Fetch Function
Current Response Return Code
Session-status Message-length
Message-return-code Message-text
DBCAREA Output Fields set by Successful Fetch Functions
Buffer Length Data Length
Fetch-data-pointer Fetch-parcel-flavor
Fetch Returned Message-text-length
Output TDP Output-host-id
TDP-receipt-timestamp Time1
Time1-status Time2
Time2-status Time3
Time3-status Time4
Time4-status Time5