SPI_prepare_cursor <refpurpose>prepare a statement, without executing it yet</refpurpose> — 文を準備する。まだ実行は行わない
SPIPlanPtr SPI_prepare_cursor(const char *command, intnargs, Oid *argtypes, intcursorOptions)
<function>SPI_prepare_cursor</function> is identical to
<function>SPI_prepare</function>, except that it also allows specification
of the planner's <quote>cursor options</quote> parameter. This is a bit mask
having the values shown in <filename>nodes/parsenodes.h</filename>
for the <structfield>options</structfield> field of <structname>DeclareCursorStmt</structname>.
<function>SPI_prepare</function> always takes the cursor options as zero.
SPI_prepare_cursorは、プランナの「カーソルオプション」パラメータを指定できる点を除き、SPI_prepareと同じです。
これはDeclareCursorStmtのoptionsフィールド用にnodes/parsenodes.hで示された値を持つビットマスクです。
SPI_prepareでは常にカーソルオプションをゼロとして扱います。
This function is now deprecated in favor
of <function>SPI_prepare_extended</function>.
この関数はSPI_prepare_extendedのため現在では廃止予定です。
const char * commandcommand string コマンド文字列
int nargs
number of input parameters (<literal>$1</literal>, <literal>$2</literal>, etc.)
入力パラメータ($1、$2など)の数
Oid * argtypespointer to an array containing the <acronym>OID</acronym>s of the data types of the parameters パラメータのデータ型のOIDを持つ配列へのポインタ
int cursorOptionsinteger bit mask of cursor options; zero produces default behavior カーソルオプションの整数ビットマスク。 ゼロはデフォルトの動作を引き起こします
<function>SPI_prepare_cursor</function> has the same return conventions as
<function>SPI_prepare</function>.
SPI_prepare_cursorはSPI_prepareと同じ戻り値の規則を持ちます。
Useful bits to set in <parameter>cursorOptions</parameter> include
<symbol>CURSOR_OPT_SCROLL</symbol>,
<symbol>CURSOR_OPT_NO_SCROLL</symbol>,
<symbol>CURSOR_OPT_FAST_PLAN</symbol>,
<symbol>CURSOR_OPT_GENERIC_PLAN</symbol>, and
<symbol>CURSOR_OPT_CUSTOM_PLAN</symbol>. Note in particular that
<symbol>CURSOR_OPT_HOLD</symbol> is ignored.
cursorOptionsに指定できるビットには、CURSOR_OPT_SCROLL、CURSOR_OPT_NO_SCROLL、CURSOR_OPT_FAST_PLAN、CURSOR_OPT_GENERIC_PLAN、CURSOR_OPT_CUSTOM_PLANがあります。
特にCURSOR_OPT_HOLDは無視される点に注意してください。