17.10 - Single Session Example - Call-Level Interface Version 2

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

Product
Call-Level Interface Version 2
Release Number
17.10
Release Date
October 2021
Content Type
Programming Reference
Publication ID
B035-2418-061K
Language
English (United States)

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

Function Description
Connect Obtain CLI2SCB, CLI2RCB, buffers; send logon; and, if options so specify, await completion; send run and return. Application must have set address and length of logon string. All other arguments (buffer sizes, run string, and various other arguments) are optional and default if they are left unset.
Fetch Fetch response data, either a Success or a Failure parcel.
Initiate Request Send Teradata SQL request to the database. Application must set address and length of Teradata SQL request and optional using data. DBCHCL builds request buffer (adds Response parcel) and sends request.
Fetch Fetch response data. DBCHCL returns address and length of first parcel (or buffer, if in Buffer Mode). If dual buffering was specified and the current buffer is not the last response buffer, DBCHCL immediately sends 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 in effect, DBCHCL sends the continue request when the current buffer is exhausted.
End Request Clean up request-related context. Disconnect. Log off the database and free the session-related control blocks.