The EXECUTE IMMEDIATE statement
Rather than prepare the statement and then execute it, you can prepare and execute the statement in the same step with the EXECUTE IMMEDIATE statement. The EXECUTE IMMEDIATE statement also frees statement-identifier resources upon completion.
For example, for the DELETE statement used in the previous
section, you can replace the PREPARE-EXECUTE statement sequence with
the following statement:
EXEC SQL execute immediate :stmt_buf;
You cannot use EXECUTE IMMEDIATE if the statement string contains input parameters. The SQL statements also have restrictions that you can execute with EXECUTE IMMEDIATE.