1SPI_CURSOR_OPEN_WITH_ARGSP(o3s)tgreSQL 9.2.24 DocumentaStPiIo_nCURSOR_OPEN_WITH_ARGS(3)
2
3
4

NAME

6       SPI_cursor_open_with_args - set up a cursor using a query and
7       parameters
8

SYNOPSIS

10       Portal SPI_cursor_open_with_args(const char *name,
11                                        const char *command,
12                                        int nargs, Oid *argtypes,
13                                        Datum *values, const char *nulls,
14                                        bool read_only, int cursorOptions)
15

DESCRIPTION

17       SPI_cursor_open_with_args sets up a cursor (internally, a portal) that
18       will execute the specified query. Most of the parameters have the same
19       meanings as the corresponding parameters to SPI_prepare_cursor and
20       SPI_cursor_open.
21
22       For one-time query execution, this function should be preferred over
23       SPI_prepare_cursor followed by SPI_cursor_open. If the same command is
24       to be executed with many different parameters, either method might be
25       faster, depending on the cost of re-planning versus the benefit of
26       custom plans.
27
28       The passed-in parameter data will be copied into the cursor's portal,
29       so it can be freed while the cursor still exists.
30

ARGUMENTS

32       const char * name
33           name for portal, or NULL to let the system select a name
34
35       const char * command
36           command string
37
38       int nargs
39           number of input parameters ($1, $2, etc.)
40
41       Oid * argtypes
42           an array containing the OIDs of the data types of the parameters
43
44       Datum * values
45           an array of actual parameter values
46
47       const char * nulls
48           an array describing which parameters are null
49
50           If nulls is NULL then SPI_cursor_open_with_args assumes that no
51           parameters are null.
52
53       bool read_only
54           true for read-only execution
55
56       int cursorOptions
57           integer bit mask of cursor options; zero produces default behavior
58

RETURN VALUE

60       Pointer to portal containing the cursor. Note there is no error return
61       convention; any error will be reported via elog.
62
63
64
65PostgreSQL 9.2.24                 2017-11-06      SPI_CURSOR_OPEN_WITH_ARGS(3)
Impressum