16.20 - Fetching the Response for a Request - Teradata Tools and Utilities

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

prodname
Teradata Tools and Utilities
vrm_release
16.20
created_date
September 2019
category
Programming Reference
featnum
B035-2417-108K

The final status and any response information for a request are obtained by the Fetch function. To fetch the final status and any response after the session is established, an application must perform the following steps:

  1. Modify the DBCAREA.
    1. Set the Function to Fetch.
    2. Set the Input CLIv2 Session Id used to initiate the request.
    3. Set the Input-CLIv2-request-number to the Output-CLIv2-request-number obtained when the request was initiated.
    4. Optionally set the following:

      Positioning-action

      Positioning-statement-number

      Positioning-value

      Fetch-maximum-data-length

      Fetch-data-pointer

      Message-area-pointer

      Message-area-length

  2. Call DBCHCL to perform the Fetch function.
  3. Check the return code from DBCHCL.
    Return Code Results
    0

    Process the parcels.

    This step depends on the setting of the options when the request was initiated and any changes from an Initiate Request, Initiate With Protocol-function, or RunStartUp function.

    The first fetch returns the outcome of the request (ok, success, failure, or error).

    The effect of the option switches on fetch processing may be found in the descriptions of the options in DBCAREA and under the heading “Fetch Function” in Common Routines.

    anything else Process the return code and DBCAREA message.
The first fetch returns the following:
  • If any statement in the request causes an implicit rollback to occur, a failure parcel for the entire request is returned.
  • If no implicit rollback happened, the ok, success, or error parcel information returned pertains to the first (or only) statement of the submitted request.