Re: Problem in calling prepare statement from STORED PROCEDURE - Mailing list pgsql-general

From Tom Lane
Subject Re: Problem in calling prepare statement from STORED PROCEDURE
Date
Msg-id 17237.1081017705@sss.pgh.pa.us
Whole thread Raw
In response to Problem in calling prepare statement from STORED PROCEDURE  ("Rajat Katyal" <rajatk@intelesoftech.com>)
List pgsql-general
"Rajat Katyal" <rajatk@intelesoftech.com> writes:
> I prepare the statement for execution as follows:
> PREPARE query(text) as SELECT count(*) FROM transform_customer_billing wher=
> e inv_no =3D $1;
> The problem is Iam not able to execute this prepare statement from the stor=
> ed procedure defined.

EXECUTE means something different in plpgsql than it does in plain SQL,
and you do not need PREPARE at all in plpgsql.  plpgsql's automatic
caching of plans gives you the effect of PREPARE on every statement
without your having to ask for it.

            regards, tom lane

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: postgres 7.4.2: float(20) results in error msg, but should not since 7.4)
Next
From:
Date:
Subject: thread_test.c problems