Supported Versions: Current (17) / 16 / 15 / 14 / 13
Development Versions: devel
Unsupported versions: 12 / 11 / 10 / 9.6 / 9.5 / 9.4 / 9.3 / 9.2 / 9.1 / 9.0 / 8.4 / 8.3 / 8.2 / 8.1 / 8.0 / 7.4
This documentation is for an unsupported version of PostgreSQL.
You may want to view the same page for the current version, or one of the other supported versions listed above instead.

SPI_execp

Name

SPI_execp -- executes a plan prepared by SPI_prepare

Synopsis

int SPI_execp(void * plan, Datum * values, const char * nulls, int count)

Description

SPI_execp executes a plan prepared by SPI_prepare. tcount has the same interpretation as in SPI_exec.

Arguments

void * plan

execution plan (returned by SPI_prepare)

Datum *values

actual parameter values

const char * nulls

An array describing which parameters are null. n indicates a null value (entry in values will be ignored); a space indicates a nonnull value (entry in values is valid).

If nulls is NULL then SPI_execp assumes that no parameters are null.

int count

number of row for which plan is to be executed

Return Value

The return value is the same as for SPI_exec or one of the following:

SPI_ERROR_ARGUMENT

if plan is NULL or count is less than 0

SPI_ERROR_PARAM

if values is NULL and plan was prepared with some parameters

SPI_processed and SPI_tuptable are set as in SPI_exec if successful.

Notes

If one of the objects (a table, function, etc.) referenced by the prepared plan is dropped during the session then the result of SPI_execp for this plan will be unpredictable.