To retrieve one or more rows containing LOB data using the deferred method, a typical parcel mode CLI application should perform the following tasks:
- Set the response mode (resp_mode) to 'M' to indicate Multipart Indicator response mode. Any other setting will result in an error condition being returned.
- Set keep_resp = 'Y'.
- Set return_object to 'T' to indicate that transaction-related locators should be returned (or 'S' for static locators).
- Issue the SQL request (including one or more SELECTs) using DBCHCL (DBFIRQ).
- After the request completes, retrieve the requisite parcel sequence along with the non-LOB columns of the answer set using DBCHCL (DBFFET). The LOB columns will not contain LOB data but, rather, LOB locators.
- If the application desires to receive LOB data at this point, continue with step 7. Otherwise, either continue receiving non-LOB data or end the request.
- Issue the SQL SELECT request using the LOB locator returned in a previous response (for example, USING (A BLOB AS LOCATOR) SELECT :A;).This SELECT must be issued on the same session.
- When appropriate, retrieve the requisite parcel sequence along with the answer set using DBCHCL (DBFFET) until an EndMultipartRecord parcel is received.
- Issue DBCHCL (DBFERQ) to end the request.