SPI_cursor_parse_open_with_paramlist — set up a cursor using a query and parameters
Portal SPI_cursor_parse_open_with_paramlist(const char *name
, const char *command
, ParamListInfoparams
, boolread_only
, intcursorOptions
)
SPI_cursor_parse_open_with_paramlist
sets up a cursor
(internally, a portal) that will execute the specified query. This
function is equivalent to SPI_cursor_open_with_args
except that any parameters referenced by the query are provided by
a ParamListInfo
object, rather than in ad-hoc arrays.
The params
object should normally mark each
parameter with the PARAM_FLAG_CONST
flag, since
a one-shot plan is always used for the query.
The passed-in parameter data will be copied into the cursor's portal, so it can be freed while the cursor still exists.
const char * name
name for portal, or NULL
to let the system
select a name
const char * command
command string
ParamListInfo params
data structure containing parameter types and values; NULL if none
bool read_only
true
for read-only execution
int cursorOptions
integer bit mask of cursor options; zero produces default behavior
Pointer to portal containing the cursor. Note there is no error
return convention; any error will be reported via elog
.