DB2 10.5 for Linux, UNIX, and Windows

Processing interactive SQL statements in dynamically executed SQL programs

You can write an application using dynamic SQL to process arbitrary SQL statements. For example, if an application accepts SQL statements from a user, the application must be able to issue the statements without any prior knowledge of the statements.

About this task

Values that are not known until execution time can be represented by parameter marks, which are denoted by question marks. Parameter marks allow for the interaction between the user and the application and is similar to host variables for static SQL statements.

Use the PREPARE and DESCRIBE statements with an SQLDA structure so that the application can determine the type of SQL statement being issued, and act accordingly.