Re: Problem in calling prepare statement from STORED PROCEDURE

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Rajat Katyal" <rajatk(at)intelesoftech(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Problem in calling prepare statement from STORED PROCEDURE
Date: 2004-04-03 18:41:45
Message-ID: 17237.1081017705@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Rajat Katyal" <rajatk(at)intelesoftech(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Wes Palmer 2004-04-03 21:32:48 thread_test.c problems
Previous Message Tom Lane 2004-04-03 18:38:51 Re: postgres 7.4.2: float(20) results in error msg, but should not since 7.4)