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

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

Product
Call-Level Interface Version 2
Release Number
16.10
Published
May 2017
Language
English (United States)
Last Update
2018-05-07
dita:mapPath
jen1488824663137.ditamap
dita:ditavalPath
Audience_PDF_include.ditaval
dita:id
B035-2417
lifecycle
previous
Product Category
Teradata Tools and Utilities

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.
    1. Set the Function to Initiate Request.
    2. Set the Input CLIv2 Session Id to the Output CLIv2 Session Id obtained when the session was established.
    3. Set the Request-pointer.
    4. Set the Request-length.
    5. 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 Results
    0 Call DBCHCL to perform a Fetch function (see Fetching the Response for a Request) 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.

The Teradata SQL request might require input data. In this situation, an application must pass the address and length of the data area to CLIv2. The USING-data-pointer and USING-data-length fields of the DBCAREA are provided for this purpose.