From 65a0db19f48920d4be4607fca15634cf6b0a3d3b Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Fri, 5 Mar 2004 00:47:01 +0000 Subject: Add new SPI functions for use by PL/Java: +extern Oid SPI_getargtypeid(void *plan, int argIndex); +extern int SPI_getargcount(void *plan); +extern bool SPI_is_cursor_plan(void *plan); Thomas Hallgren --- doc/src/sgml/spi.sgml | 186 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 185 insertions(+), 1 deletion(-) (limited to 'doc/src') diff --git a/doc/src/sgml/spi.sgml b/doc/src/sgml/spi.sgml index aab5b0dae16..a8ac6d67b84 100644 --- a/doc/src/sgml/spi.sgml +++ b/doc/src/sgml/spi.sgml @@ -1,5 +1,5 @@ @@ -573,6 +573,190 @@ void * SPI_prepare(const char * command, int n + + + SPI_getargcount + + + + SPI_getargcount + returns the number of arguments needed when executing a plan + prepared by SPI_prepare + + + SPI_getargcount + + + +int SPI_getargcount(void * plan) + + + + + Description + + + SPI_getargcount returns the number of arguments needed + when executing a plan prepared by SPI_prepare. + + + + + Arguments + + + + void * plan + + + execution plan (returned by SPI_prepare) + + + + + + + + Return Value + + The expected argument count for the plan or + SPI_ERROR_ARGUMENT if the plan + is NULL + + + + + + + + + SPI_getargtypeid + + + + SPI_getargtypeid + returns the expected typeid for the specified argument when + executing a plan prepared by SPI_prepare + + + SPI_getargtypeid + + + +Oid SPI_getargtypeid(void * plan, int argIndex) + + + + + Description + + + SPI_getargtypeid returns the Oid representing the type + id for argument at argIndex in a plan prepared by + SPI_prepare. First argument is at index zero. + + + + + Arguments + + + + void * plan + + + execution plan (returned by SPI_prepare) + + + + + + int argIndex + + + zero based index of the argument + + + + + + + + Return Value + + The type id of the argument at the given index or + SPI_ERROR_ARGUMENT if the plan is + NULL or argIndex is less than 0 or + not less than the number of arguments declared for the plan + + + + + + + + + + SPI_is_cursor_plan + + + + SPI_is_cursor_plan + returns true if a plan + prepared by SPI_prepare can be passed + as an argument to SPI_cursor_open + + + SPI_is_cursor_plan + + + +bool SPI_is_cursor_plan(void * plan) + + + + + Description + + + SPI_is_cursor_plan returns true + if a plan prepared by SPI_prepare can be passed + as an argument to SPI_cursor_open and + false if that is not the case. The criteria is that the + plan represents one single command and that this + command is a SELECT without an INTO + clause. + + + + + Arguments + + + + void * plan + + + execution plan (returned by SPI_prepare) + + + + + + + + Return Value + + true or false to indicate if the + plan can produce a cursor or not, or + SPI_ERROR_ARGUMENT if the plan + is NULL + + + + + + SPI_execp -- cgit v1.2.3