15.10 - Submitting a Teradata SQL Request - Call-Level Interface Version 2

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

Call-Level Interface Version 2
Programming Reference

A Teradata SQL request must be submitted to Teradata Database for processing by using the Initiate Request function. To initiate a request after a session is established, an application must perform the following steps:

1 Modify the DBCAREA.

a Set the Function to Initiate Request.

b Set the Input CLIv2 Session Id to the Output CLIv2 Session Id obtained when the session was established.

c Set the Request Pointer.

d Set the Request Length.

e Optionally set the following:

  • Positioning‑action
  • Positioning‑statement‑number
  • Positioning‑value
  • Request Buffer Length
  • Request‑parcel‑format
  • Response Buffer Length
  • Anticipated Number of Concurrent Sessions
  • Request‑token
  • Using Data Pointer
  • Using Data Length
  • Using‑data‑count
  • Using‑data‑length‑vector
  • Using‑data‑pointer‑vector
  • Data‑encryption
  • Message Area Pointer
  • Message Area Length
  • Any option values required (remember to set Change Options = Y if any option values are changed)
  • 2 Call DBCHCL to perform the Initiate Request function.

    3 Check the return code from DBCHCL:


    Return Code



    Call DBCHCL to perform a Fetch function (see “Fetching the Response for a Request” on page 58) until the complete response has been processed.

    anything else

    Process the return code and DBCAREA message.

    4 Call DBCHCL to perform the End Request function. See “Ending a Request” on page 60.

    The Teradata SQL request might require input data. In this situation, an application must pass the address and length of the data area to CLI. The Using Data Pointer and Using Data Length fields of the DBCAREA are provided for this purpose.