On this page
SPI_cursor_open_with_paramlist
SPI_cursor_open_with_paramlist —使用参数设置游标
Synopsis
Portal SPI_cursor_open_with_paramlist(const char *name,
SPIPlanPtr plan,
ParamListInfo params,
bool read_only)
Description
SPI_cursor_open_with_paramlist
设置了一个游标(内部为门户),该游标将执行SPI_prepare
准备的语句。此函数等效于SPI_cursor_open
,只是有关传递给查询的参数值的信息以不同的方式显示。 ParamListInfo
表示形式可以方便地传递该格式中已经可用的值。它还支持通过ParamListInfo
中指定的钩子函数使用动态参数集。
传入的参数数据将被复制到游标的门户中,因此可以在游标仍然存在时将其释放。
Arguments
const char * name
- 门户的名称,或
NULL
以让系统选择名称
- 门户的名称,或
SPIPlanPtr plan
- 准备好的语句(由
SPI_prepare
返回)
- 准备好的语句(由
ParamListInfo params
- 包含参数类型和值的数据结构;如果没有则为 NULL
bool read_only
true
用于只读执行
Return Value
指向包含光标的门户的指针。注意没有错误返回约定。任何错误将通过elog
报告。