Executing a stored procedure
You execute a stored procedure in the SQL command by using either the CALL or EXEC[UTE[ PROCEDURE]] commands.
For example, if you have a stored procedure named
updateacct()
, you can run it
by using any of the following
commands:MYDB.SCHEMA(USER)=> CALL updateacct();
MYDB.SCHEMA(USER)=> EXEC updateacct();
MYDB.SCHEMA(USER)=> EXECUTE updateacct();
MYDB.SCHEMA(USER)=> EXECUTE PROCEDURE updateacct();
You can also use the SELECT command to execute a procedure. You cannot specify a FROM clause.
For example:
MYDB.SCHEMA(USER)=> SELECT updateacct();
Tip: If you are observing
expression_tree_walker
errors while you are
running stored procedures, set spi_simplify_expr=false at a session level to skip
the SPI layer simplification, and run the stored
procedure.set spi_simplify_expr =false; YOUR STORED PROECDURE
To execute the procedure, the user must be the owner of or have permission to execute the
updateacct()
procedure.