SPI_cursor_open_with_paramlist — 使用参数设置游标
Portal SPI_cursor_open_with_paramlist(const char *name
, SPIPlanPtrplan
, ParamListInfoparams
, boolread_only
)
SPI_cursor_open_with_paramlist
设置一个游标(在内部为一个门户),它将执行由 SPI_prepare
准备的语句。此函数等同于 SPI_cursor_open
,只是以不同的方式提供要传递给查询的参数值的信息。对于以这种格式已经可用的值,ParamListInfo
表示形式会很方便。它还支持通过 ParamListInfo
中指定的后钩函数使用动态参数集。
传入的参数数据将复制到游标的门户中,因此在游标仍然存在时可以释放它。
const char * name
门户名称,或 NULL
让系统选择名称
SPIPlanPtr plan
预处理语句(由 SPI_prepare
返回)
ParamListInfo params
包含参数类型和值的数据结构;如果无,则为 NULL
bool read_only
true
表示只读执行
包含游标的门户指针。请注意,没有错误返回约定;任何错误都将通过 elog
报告。