Movatterモバイル変換


[0]ホーム

URL:



Facebook
Postgres Pro
Facebook
Downloads
CALL
Prev UpSQL CommandsHome Next

CALL

CALL — invoke a procedure

Synopsis

CALLname ( [argument ] [, ...] )

Description

CALL executes a procedure.

If the procedure has any output parameters, then a result row will be returned, containing the values of those parameters.

Parameters

name

The name (optionally schema-qualified) of the procedure.

argument

An argument expression for the procedure call.

Arguments can include parameter names, using the syntaxname =>value. This works the same as in ordinary function calls; seeSection 4.3 for details.

Arguments must be supplied for all procedure parameters that lack defaults, includingOUT parameters. However, arguments matchingOUT parameters are not evaluated, so it's customary to just writeNULL for them. (Writing something else for anOUT parameter might cause compatibility problems with futurePostgreSQL versions.)

Notes

The user must haveEXECUTE privilege on the procedure in order to be allowed to invoke it.

To call a function (not a procedure), useSELECT instead.

IfCALL is executed in a transaction block, then the called procedure cannot execute transaction control statements. Transaction control statements are only allowed ifCALL is executed in its own transaction.

PL/pgSQL handles output parameters inCALL commands differently; seeSection 41.6.3.

Examples

CALL do_db_maintenance();

Compatibility

CALL conforms to the SQL standard, except for the handling of output parameters. The standard says that users should write variables to receive the values of output parameters.


Prev Up Next
BEGIN Home CHECKPOINT
pdfepub
Go to PostgreSQL 17
By continuing to browse this website, you agree to the use of cookies. Go toPrivacy Policy.

[8]ページ先頭

©2009-2025 Movatter.jp