P. 1
prog_postgresql

prog_postgresql

|Views: 169|Likes:
Published by Armin_Vera_Bec_5685

More info:

Published by: Armin_Vera_Bec_5685 on Jan 05, 2011
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

11/16/2012

pdf

text

original

Name

SPI_execp Executes a plan from SPI_saveplan

Synopsis

SPI_execp(plan,

values,

nulls,

tcount)

Inputs

void *plan

Execution plan

Datum *values

Actual parameter values

char *nulls

Array describing what parameters get NULLs

’n’ indicates NULL allowed
’ ’ indicates NULL not allowed

int tcount

Number of tuples for which plan is to be executed

Outputs

int

Returns the same value as SPI_exec as well as

SPI_ERROR_ARGUMENT if plan is NULL or tcount < 0
SPI_ERROR_PARAM if values is NULL and plan was prepared with some parameters.

Chapter 15. Server Programming Interface

100

SPI_tuptable

initialized as in SPI_exec if successful

SPI_processed

initialized as in SPI_exec if successful

Description

SPI_execp stores a plan prepared by SPI_prepare in safe memory protected from freeing by

SPI_finish or the transaction manager.

In the current version of Postgres there is no ability to store prepared plans in the system
catalog and fetch them from there for execution. This will be implemented in future versions.
As a work arround, there is the ability to reuse prepared plans in the consequent invocations of
your procedure in the current session. Use SPI_execp to execute this saved plan.

Usage

If nulls is NULL then SPI_execp assumes that all values (if any) are NOT NULL.

Note: If one of the objects (a relation, function, etc.) referenced by the prepared plan is
dropped during your session (by your backend or another process) then the results of

SPI_execp for this plan will be unpredictable.

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->