2025年9月25日: PostgreSQL 18 釋出!
支援的版本: 當前 (18) / 17 / 16 / 15 / 14 / 13
開發版本: devel
不支援的版本: 12 / 11 / 10 / 9.6 / 9.5 / 9.4 / 9.3 / 9.2 / 9.1 / 9.0

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 設定一個遊標(在內部,是一個 portal),該遊標將執行由 SPI_prepare 準備的語句。此函式等同於 SPI_cursor_open,唯一的區別在於傳遞給查詢的引數值資訊呈現方式不同。 ParamListInfo 結構體表示形式對於傳遞已以該格式提供的引數值非常方便。它還支援透過 ParamListInfo 中指定的鉤子函式使用動態引數集。

傳入的引數資料將被複制到遊標的 portal 中,因此可以在遊標仍然存在時釋放這些資料。

引數

const char * name

portal 的名稱,如果為 NULL,則由系統選擇名稱

SPIPlanPtr plan

已準備好的語句(由 SPI_prepare 返回)

ParamListInfo params

包含引數型別和值的結構體;如果無引數則為 NULL

bool read_only

只讀執行時為 true

返回值

指向包含遊標的 portal 的指標。請注意,沒有錯誤返回約定;任何錯誤都將透過 elog 報告。

提交更正

如果您在文件中發現任何不正確之處、與您對特定功能的實際體驗不符之處,或需要進一步說明之處,請使用 此表單 報告文件問題。