Use the CALL command, EXEC command, EXECUTE command, or EXECUTE PROCEDURE command to invoke a stored procedure on a IBM® Netezza® host.
The CALL, EXEC, EXECUTE, EXECUTE PROCEDURE commands are identical in their behavior, inputs, and outputs. The different commands provide compatibility with other procedural language invocation methods. You can also use the SELECT command to invoke a stored procedure.
CALL procedure_name(arguments)
EXEC procedure_name(arguments)
EXECUTE procedure_name(arguments)
EXECUTE PROCEDURE procedure_name(arguments)
SELECT procedure_name(arguments)
| Input | Description |
|---|---|
| procedure_name | The name of the stored procedure that you want to invoke. If
you specify only a procedure name, the system searches the current
database and schema, and then search PATH to find the procedure. You can specify a fully qualified object name to execute a procedure defined in a different database or schema. |
| arguments | Specifies a list of constant or literal arguments to the procedure. The arguments might be results of functions when the functions take only constant or literal arguments as well. |
The CALL and EXEC[UTE [PROCEDURE] commands have the following outputs:
| Output | Description |
|---|---|
| ERROR: EXECUTE PROC: Permission denied. | This error indicates that the current user account does not have Execute permission for the stored procedure. |
| ERROR: Function 'NAME(ARGS)'
does not exist Unable to identify a function that satisfies the argument types You might need to add explicit typecasts |
This message indicates that the user entered incorrect arguments for the stored procedure. A procedure of that name exists, but it is expecting different input arguments. |
MYDB.MYSCH(USER)=> CALL updateacct();
MYDB.MYSCH(USER)=> EXEC schema_two.myproc();
MYDB.MYSCH(USER)=> EXECUTE sales.dev.inventorysearch(umbrellas);
MYDB.MYSCH(USER)=> EXECUTE PROCEDURE updateacct();
MYDB.MYSCH(USER)=> SELECT updateacct();
MYDB.MYSCH(USER)=> SELECT inventorysearch(umbrellas);