A Teradata SQL request must be submitted to the 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:
- Modify the DBCAREA.
- Set the Function to Initiate Request.
- Set the Input CLIv2 Session Id to the Output CLIv2 Session Id obtained when the session was established.
- Set the Request-pointer.
- Set the Request-length.
- Optionally set the following:
Any option values required (remember to set Change-options = Y if any option values are changed)
- Call DBCHCL to perform the Initiate Request function.
- 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.
- 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.