支援的版本:目前 (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 中指定的 hook 函數來使用動態參數集。

傳入的參數資料將被複製到游標的入口中,因此可以在游標仍然存在時釋放它。

引數

const char * name

入口的名稱,或者 NULL 讓系統選擇一個名稱

SPIPlanPtr plan

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

ParamListInfo params

包含參數類型和數值的資料結構;如果沒有,則為 NULL

bool read_only

對於唯讀執行的 true

回傳值

包含游標的入口指標。請注意,沒有錯誤回傳慣例;任何錯誤都會透過 elog 報告。

提交更正

如果您在文件中發現任何不正確的地方,或者與您使用特定功能的經驗不符,或者需要進一步澄清,請使用此表單來報告文件問題。