Skip to main content
Skip table of contents

Command Statement

A command statement executes an SQL command such as SELECT, INSERT, UPDATE, DELETE, EXECUTE, or a dynamic SQL command, etc., against one or more data sources.

Usage

SQL
command [(WITH|WITHOUT) RETURN];

Syntax

  • EXECUTE command statements may access IN/OUT, OUT, and RETURN parameters. To access the return value, the statement will have the form var = EXEC proc.... To access OUT or IN/OUT values named parameter syntax must be used. For example, EXEC proc(in_param=>'1', out_param=>var) will assign the value of the OUT parameter to the variable var. It is expected that the data type of a parameter will be implicitly convertible to the datatype of the variable;
  • The RETURN clause determines if the result of the command is returnable from the procedure. The default is WITH RETURN . If the command does not return a result set or the procedure does not return a result set, the RETURN clause is ignored. If WITH RETURN is specified, the result set of the command must match the expected result set of the procedure. Only the last successfully executed statement executed WITH RETURN will be returned as the procedure result set. If there are no returnable result sets and the procedure declares that a result set will be returned, then an empty result set is returned.

Examples

Command Statement Without Return

SQL
BEGIN
	EXECUTE 'SELECT 1' WITHOUT RETURN;
END ;;

Command Statement With Return

SQL
BEGIN
	EXECUTE 'SELECT 1' [WITH RETURN];
END ;;

The default is WITH RETURN, so the part in square brackets can be omitted.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.