No Rewinding, Single Buffering | Analytics Database (SQL Engine) - No Rewinding, Single Buffering - Call-Level Interface Version 2

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

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
Lake
VMware
Product
Call-Level Interface Version 2
Release Number
20.00
Published
January 2024
Language
English (United States)
Last Update
2024-05-14
dita:mapPath
bmn1691484839905.ditamap
dita:ditavalPath
obe1474387269547.ditaval
dita:id
fvz1470444150352
Product Category
Teradata Tools and Utilities
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. Otherwise, it consumes the unit of response. Typically, the application loops back for another unit of response until the EndRequest parcel is obtained.