EXECUTE IMMEDIATE

Performs a simple SQL execution without SQL parameters or result set.

Syntax

EXECUTE IMMEDIATE sqltext
  1. sqltext is a string expression containing the SQL statement to be executed.

Usage

The EXECUTE IMMEDIATE instruction passes an SQL statement to the database server for execution in the current database connection.

The SQL statement used by EXECUTE IMMEDIATE must be a single statement without SQL parameters and must not produce a result set.

This instruction is equivalent to PREPARE, EXECUTE and FREE in one step.

Example

MAIN
  DATABASE stores 
  EXECUTE IMMEDIATE "UPDATE tab SET col='aaa' WHERE key=345"
END MAIN