Implementing static SQL in DB2

When the complete SQL statement is known at pre-compile time, it is known as static SQL. All aspects of the SQL statement, such as the table name, column names, filter criteria, and so on must be specified at pre-compile time. The only thing that can be passed at the time of execution are host variables. Even if we have host variables, the complete information such as data type, length, and so on, must be available at the pre-compile time. Static SQL statements can be embedded in all languages except interpreted languages. At the time of pre-compilation, the language pre-processor converts the static SQL code into database manager run-time service API calls which the compiler can understand. In the case of interpreted ...

Get IBM DB2 9.7 Advanced Application Developer Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.