©
This document usesPHP Chinese website manualRelease
SPIPlanPtr SPI_prepare_cursor(const char *command, intnargs, Oid *argtypes, intcursorOptions)
SPI_prepare_cursoris identical toSPI_prepare, except that it also allows specification of the planner's"cursor options"parameter. This is a bit mask having the values shown innodes/parsenodes.hfor theoptionsfield ofDeclareCursorStmt.SPI_preparealways takes the cursor options as zero.
command string
number of input parameters ($1,$2, etc.)
pointer to an array containing theOIDs of the data types of the parameters
integer bit mask of cursor options; zero produces default behavior
SPI_prepare_cursorhas the same return conventions asSPI_prepare.
Useful bits to set incursorOptionsincludeCURSOR_OPT_SCROLL,CURSOR_OPT_NO_SCROLL, andCURSOR_OPT_FAST_PLAN. Note in particular thatCURSOR_OPT_HOLDis ignored.