SQL Notebook (logo)

EXECUTE Statement

Executes the script called script-name, which may be enclosed in quotes if the script name contains spaces or special characters. If a result-variable is specified, then that variable will contain the scalar value, if any, returned from the script. The result-variable does not need to be declared beforehand; the EXECUTE statement itself will declare the variable if it does not exist. If the script does not call RETURN, then the return value is NULL.

A script may define its own input parameters using the DECLARE PARAMETER statement. If parameters are present in the script, then any EXECUTE statement that calls it must provide argument values for those parameters. The exception is if the DECLARE PARAMETER statement includes a default value. If so, then the EXECUTE statement may omit that parameter, or it may use the special keyword DEFAULT; in both cases, the default value defined by the DECLARE PARAMETER statement is used.


Syntax for the EXECUTE statement