EXECUTE IMMEDIATE
- Last Updated: January 17, 2024
- 1 minute read
- OpenEdge
- Version 12.8
- Documentation
Executes the statement specified in a statement_string or host_variable.
Syntax
|
Parameters
- statement_string
-
The character string form of the statement.
- host_variable
-
The host variable name which passes values between the database and the application program.
Notes
- The
character string form of the statement is referred to as a statement
string. An
EXECUTE IMMEDIATEstatement accepts either a statement string or a host variable as input. - A statement string must not contain host variable references or parameter markers.
- A statement string must not begin with
EXEC SQLdelimiter and must not end with a semicolon. - When an
EXECUTE IMMEDIATEstatement is executed, the SQL engine parses the statement and checks it for errors. Any error in the execution of the statement is reported in the SQLCA. - If the same SQL statement is to be executed multiple times,
it is more efficient to use
PREPAREandEXECUTEstatements, rather than anEXECUTE IMMEDIATEstatement.