- Supplies the session id if the DBCAREA has been used for another session since last used for this session
- Supplies the maximum Request Buffer and Response Buffer lengths if the DBCAREA has been used with other lengths since they were last set
- Supplies the length of, and a pointer to, the Teradata SQL request. The combined request and data with a USING modifier should not exceed 32500 bytes for a 32K buffer, 65000 bytes for a 64K buffer, or 1048500 for a 1M buffer.
- Supplies a pointer to and the data for the USING modifier if the Teradata SQL request contained a Teradata SQL statement with a USING modifier
- May change the settings of the processing options
- Sets the function code to DBFIRQ
- Calls DBCHCL
- Function field of the MTDP control block is set to MTDPRET
- Session and request identifier fields of the MTDPCB are set to the active session and request identifiers
- Waitdata option is set according to the value of the DBCAREA waitdata option flag
- MTDP is called to wait for completion of the active request
MTDP checks if the specified request has completed, and, if the waitdata options flag is true, waits until the response message for the prior request arrives or an error occurs, and then returns control to DBCHCL.
If an active request was completed, the state flag of its RCB is posted as pending, making the request available for fetches.
- Creates an RCB for the new request
- Inserts it at the head of the request lists on the associated SCB
- Fills in its options fields from either the SCB of the associated session or the DBCAREA if the set options flag is set to Y. allocates request and response buffers based on the lengths specified in the DBCAREA or, if none are given, the default lengths specified in the CLI2SPB
- Loads the Request Buffer with parcels:
- A Req, FMReq or IndicReq parcel depending on the Record Mode option flag, containing the Teradata SQL request
- One Data or IndicData parcel if the Teradata SQL request contained a Teradata SQL statement with a USING modifier
- A Resp or KeepResp parcel containing the length of the Response Buffer
- Provides the length of and a pointer to the Request Buffer
- Provides the length of and a pointer to the Response Buffer
- Modifies the selfrecov option (if needed).
- Sets MTDPSTA in the function code of the MTDP Control Block
- Assigns a request id
- Calls MTDP
MTDP submits a Start Request message to the database, and returns control to DBCHCL.
- An error or success message is generated and returned to the application in the message field of the DBCAREA
- The logical request identifier is returned in the request substructure of the DBCAREA
- DBCHCL returns to the application
If the return code in the DBCAREA is not normal, the application makes the appropriate changes and re-submits the DBCAREA to DBCHCL, as above. Otherwise, the application saves the request id if the application program plans to use the DBCAREA for any other concurrent request. The interface is ready for the application to consume the Teradata SQL response.