Processing non-SELECT statements

 

Before building a dynamic SQL non-SELECT statement, verify that this SQL statement is allowed to be run dynamically.

To run a dynamic SQL non-SELECT statement:

  1. Run the SQL statement using EXECUTE IMMEDIATE, or PREPARE the SQL statement, then EXECUTE the prepared statement.

  2. Handle any SQL return codes that might result.

The following is an example of an application running a dynamic SQL non-SELECT statement (stmtstrg):

  EXEC SQL    EXECUTE IMMEDIATE :stmtstrg;

 

Parent topic:

Dynamic SQL applications

 

Related concepts


Dynamic SQL applications
Using interactive SQL