O'Reilly logo

SQL in a Nutshell by Kevin Kline

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

CALL

Synopsis

The CALL statement invokes a stored procedure.

Vendor

Command

SQL Server

Not supported

MySQL

Not supported

Oracle

Supported

PostgreSQL

Supported

SQL99 Syntax and Description

CALL procedure_name [(parameter [,...n] )]

The CALL statement makes it easy to invoke a stored procedure. Simply provide the name of the stored procedure and include any parameters used by the stored procedure, enclosing them within parentheses. If the stored procedure has only OUT parameters, or has no parameters, empty parentheses may be included.

Tip

Microsoft SQL Server does not support the CALL statement. However, nearly identical functionality can be achieved using the EXECUTE statement. Refer to the vendor documentation for a full explanation of this SQL Server extension.

Oracle Syntax and Variations

CALL [schema.][{type_name | package_name}.]procedure_name@dblink 
[(parameter [,...n] )]
[INTO :variable_name [INDICATOR :indicator_name] ]

Oracle allows the CALL statement to invoke standalone stored procedures, functions, methods, as well as stored procedures and functions contained within a type or package. If the procedure or function resides in another database, simply declare the database via a dblink statement, stating where the object resides, as part of the CALL statement. dblink must refer to a previously created database link.

If the called routine is a function, Oracle requires the INTO clause. Conversely, INTO can be used only when invoking functions. The variable that will ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required