EXECUTE IMMEDIATE
EXECUTE IMMEDIATE — dynamically prepare and execute a statement
Synopsis
EXECUTE IMMEDIATEstringDescription
EXECUTE IMMEDIATE immediately prepares and executes a dynamically specified SQL statement, without retrieving result rows.
Parameters
stringA literal C string or a host variable containing the SQL statement to be executed.
Examples
Here is an example that executes anINSERT statement usingEXECUTE IMMEDIATE and a host variable namedcommand:
sprintf(command, "INSERT INTO test (name, amount, letter) VALUES ('db: ''r1''', 1, 'f')");EXEC SQL EXECUTE IMMEDIATE :command;Compatibility
EXECUTE IMMEDIATE is specified in the SQL standard.