SPI_prepare_cursor

SPI_prepare_cursor —准备一条语句,但尚未执行

Synopsis

SPIPlanPtr SPI_prepare_cursor(const char * command, int nargs,
                              Oid * argtypes, int cursorOptions)

Description

SPI_prepare_cursorSPI_prepare相同,除了它还允许指定计划者的“光标选项”参数。这是一个位掩码,具有DeclareCursorStmtoptions字段的nodes/parsenodes.h中所示的值。 SPI_prepare始终将光标选项设为零。

Arguments

  • const char * command

    • command string
  • int nargs

    • Importing 参数的数量($1$2等)
  • Oid * argtypes

    • 指向包含参数数据类型的 OID 的数组的指针
  • int cursorOptions

    • 游标选项的整数位掩码;零产生默认行为

Return Value

SPI_prepare_cursorSPI_prepare具有相同的返回约定。

Notes

  • cursorOptions *中设置的有用位包括CURSOR_OPT_SCROLLCURSOR_OPT_NO_SCROLLCURSOR_OPT_FAST_PLANCURSOR_OPT_GENERIC_PLANCURSOR_OPT_CUSTOM_PLAN。特别注意CURSOR_OPT_HOLD被忽略。