Static SQL statements
The source form of a static SQL statement is embedded within an application program written in a host language such as COBOL. The statement is prepared before the program is executed and the operational form of the statement persists beyond the execution of the program.
Static SQL statements in a source program must be processed before the program is compiled. This processing can be accomplished through the Db2 coprocessor or Db2 precompiler. The Db2 coprocessor or Db2 precompiler checks the syntax of the SQL statements, turns them into host language comments, and generates host language statements to invoke Db2.
The preparation of an SQL application program includes processing of the SQL statements, the preparation of its static SQL statements, and compilation of the modified source program.