Dynamic SQL

Dynamic SQL allows a client application to execute SQL statements containing variables whose values are determined at runtime.

A client application prepares a dynamic SQL statement by associating a SQL statement containing placeholders with an identifier and sending the statement to an Open Server application to be partially compiled and stored. The statement is then known as a prepared statement.

When a client application is ready to execute a prepared statement, it defines values to substitute for the SQL statement’s placeholders and sends a command to execute the statement. These values become the command’s input parameters.

Once the statement has executed the prescribed number of times, the client application deallocates the statement.