]> begriffs open source - ai-pg/blob - full-docs/txt/sql-call.txt
Convert HTML docs to more streamlined TXT
[ai-pg] / full-docs / txt / sql-call.txt
1
2 CALL
3
4    CALL — invoke a procedure
5
6 Synopsis
7
8 CALL name ( [ argument ] [, ...] )
9
10 Description
11
12    CALL executes a procedure.
13
14    If the procedure has any output parameters, then a result row will be
15    returned, containing the values of those parameters.
16
17 Parameters
18
19    name
20           The name (optionally schema-qualified) of the procedure.
21
22    argument
23           An argument expression for the procedure call.
24
25           Arguments can include parameter names, using the syntax name =>
26           value. This works the same as in ordinary function calls; see
27           Section 4.3 for details.
28
29           Arguments must be supplied for all procedure parameters that
30           lack defaults, including OUT parameters. However, arguments
31           matching OUT parameters are not evaluated, so it's customary to
32           just write NULL for them. (Writing something else for an OUT
33           parameter might cause compatibility problems with future
34           PostgreSQL versions.)
35
36 Notes
37
38    The user must have EXECUTE privilege on the procedure in order to be
39    allowed to invoke it.
40
41    To call a function (not a procedure), use SELECT instead.
42
43    If CALL is executed in a transaction block, then the called procedure
44    cannot execute transaction control statements. Transaction control
45    statements are only allowed if CALL is executed in its own transaction.
46
47    PL/pgSQL handles output parameters in CALL commands differently; see
48    Section 41.6.3.
49
50 Examples
51
52 CALL do_db_maintenance();
53
54 Compatibility
55
56    CALL conforms to the SQL standard, except for the handling of output
57    parameters. The standard says that users should write variables to
58    receive the values of output parameters.
59
60 See Also
61
62    CREATE PROCEDURE