Skip to Main Content
SQL in a Nutshell
book

SQL in a Nutshell

by Kevin Kline
December 2000
Intermediate to advanced content levelIntermediate to advanced
224 pages
9h 52m
English
O'Reilly Media, Inc.
Content preview from SQL in a Nutshell

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 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

SQL in a Nutshell, 3rd Edition

SQL in a Nutshell, 3rd Edition

Kevin Kline

Publisher Resources

ISBN: 1565927443