16.20 - Single Session Example - Teradata Tools and Utilities

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

Teradata Tools and Utilities
September 2019
Programming Reference

Each horizontal item below represents a call to DBCHCL, with function code set as in the left column.

Function Description

Application must have set address and length of logon string.

All other arguments (buffer sizes, run string, and various other arguments) are optional and will default if they are left unset.

Fetch Fetch response data, always one of the following parcels:
  • Success
  • Error
  • StatementError
  • Failure
Initiate Request

Send Teradata SQL request to the Teradata Database.

Application must set address and length of the Teradata SQL request and optional using data.


Fetch response data. DBCHCL will return address and length of first parcel (or buffer, if in buffer mode).

The DBCHCL does the following, depending on whether dual buffering is specified and the status of the current buffer:
  • If dual buffering is specified and the current buffer is not the last response buffer, DBCHCL immediately dispatches a continue request to retrieve the next buffer full of data. Thus, the continue request process is overlapped with consumption of the first buffer.
  • If dual buffering is not specified and the current buffer is in any status, DBCHCL transparently dispatches the continue request when the current buffer is exhausted.
End Request Clean up request-related context.
Disconnect Log off from the Teradata Database and free the session-related control blocks