Redrock Postgres 搜索 英文
版本: 9.3 / 9.4 / 9.5 / 9.6 / 10 / 11 / 12 / 13 / 14 / 15 / 16 / 17

SPI_cursor_open_with_paramlist

SPI_cursor_open_with_paramlist — 使用参数设置游标

概述

Portal SPI_cursor_open_with_paramlist(const char *name,
                                      SPIPlanPtr plan,
                                      ParamListInfo params,
                                      bool read_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 报告。