On this page
SPI_prepare_cursor
SPI_prepare_cursor —准备一条语句,但尚未执行
Synopsis
SPIPlanPtr SPI_prepare_cursor(const char * command, int nargs,
Oid * argtypes, int cursorOptions)
Description
SPI_prepare_cursor
与SPI_prepare
相同,除了它还允许指定计划者的“光标选项”参数。这是一个位掩码,具有DeclareCursorStmt
的options
字段的nodes/parsenodes.h
中所示的值。 SPI_prepare
始终将光标选项设为零。
Arguments
const char * command
- command string
int nargs
- Importing 参数的数量(
$1
,$2
等)
- Importing 参数的数量(
Oid * argtypes
- 指向包含参数数据类型的 OID 的数组的指针
int cursorOptions
- 游标选项的整数位掩码;零产生默认行为
Return Value
SPI_prepare_cursor
与SPI_prepare
具有相同的返回约定。
Notes
cursorOptions
*中设置的有用位包括CURSOR_OPT_SCROLL
,CURSOR_OPT_NO_SCROLL
,CURSOR_OPT_FAST_PLAN
,CURSOR_OPT_GENERIC_PLAN
和CURSOR_OPT_CUSTOM_PLAN
。特别注意CURSOR_OPT_HOLD
被忽略。