"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