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; however,
you cannot specify a FROM clause. For example:
MYDB.SCHEMA(USER)=> SELECT updateacct();
To execute the procedure, the user must be the owner of or have
permission to execute the updateacct()
procedure.