postgre-sql / 10.7 / reference / spi-spi-cursor-open-with-paramlist.html

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报告。