17.10 - No Rewinding, Single Buffering - 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)
The following information applies if the application chose single-buffering when initiating the request, and is choosing now to see the response without rewinding it.

Application

In the DBCAREA, the application supplies the session id and request id of the request from which data is to be fetched and sets the function code to DBFFET.

If the request was submitted with the Move Mode processing option, the application program must also supply the length of and a pointer to the response area in the DBCAREA. DBCHCL is then called to perform the fetch.

DBCHCL

DBCHCL first determines whether options flags are to be taken from the RCB of the specified request or from the set options flag of the DBCAREA. If set options flag is Y, options are taken from the DBCAREA, otherwise the options in the RCB are used.

If the next unit of response is not in the Response Buffer, DBCHCL:
  • Supplies the session and request identifiers for the specified request in the MTDPCB
  • Constructs a continue request in the request buffer for the request by creating a Resp or KeepResp Parcel
  • Sets the function code of the MTDPCB to MTDPCONT
  • Calls MTDP

MTDP

MTDP sends a Continue Request message to the database. It then returns control to DBCHCL.

DBCHCL

If the specified request is active, DBCHCL performs the following tasks:
  • Supplies the session id and request id of the active request in the MTDPCB
  • Sets the waitdata option flag according to the input options waitdata value
  • Sets the function code to MTDPRET
  • Calls MTDP

MTDP

MTDP checks if the request has completed, and, if waitdata is TRUE, waits until the response message for the prior request arrives or an error occurs, and then returns control to DBCHCL.

DBCHCL

If all prior calls to MTDP have returned successfully, DBCHCL checks for a buffer overflow; if one is found, the buffer is grown to accommodate the larger response, and the request is continued. DBCHCL makes the next unit of response available to the application program by locating the next parcel and returning it to the application either through a pointer into the response buffer, or, if Move Mode has been specified, by copying the parcel into the buffer provided by the application and pointed to be the data field of the DBCAREA.

Application

If the return code or error flag in the DBCAREA are not normal, the application makes the appropriate changes, and re-submits the MTDP Control Block to DBCHCL, as above. Otherwise, it consumes the unit of response. Typically, the application loops back for another unit of response until the EndRequest parcel is obtained.