You can implement many existing dynamic applications as static procedures with little preparatory work. A FOCEXEC does not require special coding (for example, embedded SQL) to use static SQL. All current MODIFY procedures that update DB2 or DB2 for VM tables (and can currently be compiled), and most current FOCEXEC procedures that access DB2 or DB2 for VM tables using the TABLE FILE or MATCH FILE commands, can be registered as static SQL procedures with no alterations.
A MODIFY procedure to be compiled with the Static SQL for MODIFY facility can also contain SQL commands (for example, SQL COMMIT WORK, INSERT, or UPDATE). A FOCEXEC to be compiled with the Static SQL for TABLE facility can contain SQL commands, MODIFY procedures, Direct SQL Passthru commands, and Dialogue Manager commands, although the Static SQL for TABLE facility does not convert these commands to static SQL. The FOCEXEC can also invoke other FOCEXECs; however, to run these additional FOCEXECs statically, you must convert them separately to static SQL.
You must satisfy the following requirements to create a static SQL procedure:
A TABLE request can contain Dialogue Manager variables, and you can substitute new values when you execute the static procedure (see SQL COMPILE and SQL RUN Processing).
The DB2 Data Adapter must have been installed to use the Call Attachment Facility (CAF). You can verify this by using the SQL DB2 ? command to display Data Adapter settings (Call Attachment Facility should be ON). There is no similar requirement for DB2 for VM.
The DB2 environment prohibits the type of static SQL syntax the data adapter uses against a DB2 view created with a GROUP BY or HAVING clause. If you issue a static COMPILE for a FOCEXEC that operates against such a view, an SQLCODE of -815 results either at BIND or RUN time, depending on your current level of DB2 maintenance.
The DB2 for VM product does not support double-byte character set (DBCS) data types in static SQL procedures of the type generated by the data adapter.
Note:
Information Builders |