You can use the Deferred-Prepare and Open-Fetch-Close Optimization (OPTOFC) features in combination. The OPTOFC feature delays sending the OPEN message to the database server until the FETCH message is sent. The following situations occur if you enable the Deferred-Prepare and OPTOFC features at the same time:
The database server performs an internal execution of a SET DESCRIPTOR statement which sets the TYPE, LENGTH, DATA, and other fields in the system descriptor area. You can specify a GET DESCRIPTOR statement after the FETCH statement to see the data that is returned.
Related statements: DECLARE , DESCRIBE, EXECUTE , OPEN , and PREPARE
For a task-oriented discussion of the PREPARE statement and dynamic SQL, see the IBM Informix Guide to SQL: Tutorial.
For more information about concepts that relate to the SET DEFERRED_PREPARE statement, see the IBM Informix ESQL/C Programmer's Manual.