Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id 7D306475A7F for ; Fri, 24 May 2002 07:53:39 -0400 (EDT) Received: from mail-relay.trade-india.com (mail-relay.trade-india.com [203.196.129.235]) by postgresql.org (Postfix) with SMTP id 940C9475951 for ; Fri, 24 May 2002 07:53:24 -0400 (EDT) Received: (qmail 26032 invoked from network); 24 May 2002 11:47:30 -0000 Received: from system29.trade-india-local.com (HELO server) (192.168.0.29) by ptil-236-129-del.primus-india.net with SMTP; 24 May 2002 11:47:30 -0000 Content-Type: text/plain; charset="iso-8859-1" From: "Rajesh Kumar Mallah." Organization: Infocom Network Limited. To: Gabriel Dovalo Carril Subject: Re: Functions with dynamic queries Date: Fri, 24 May 2002 17:23:17 +0530 X-Mailer: KMail [version 1.4] Cc: Lista SQL de postgres References: <3CECC5C5.BDF77592@terra.es> <200205231914.27923.mallah@trade-india.com> <3CEDF8AA.4CFF9A8C@terra.es> In-Reply-To: <3CEDF8AA.4CFF9A8C@terra.es> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200205241723.17095.mallah@trade-india.com> X-Archive-Number: 200205/264 X-Sequence-Number: 7899 Hi Gabriel, I am not very adept in using PLPGSQL. Once I had tried to create a query dynamically and execute it but did not work out (but i do not exactly remeber the problem). but what i feel is using "EXECUTE" would be a overkill. I think Jeff has almost solved your problem and with your little coperation the problem can be sorted out. If you still really need the solution desperately i would apprecite if you could prepare an .sql file which creates , the table and inserts some data relevent to the SQL query into it , attach it and post to the list. Regds Mallah. > And I need to know how can a query be executed substituting > variables. > On Friday 24 May 2002 01:54 pm, Gabriel Dovalo Carril wrote: > "Rajesh Kumar Mallah." escribi=F3: > > I guess the examples on standard docs explain it. > > dont they? > > Hi Rajesh, > > I have read docs examples again, and even examples at: > > http://www.brasileiro.net/postgres/plpgsql/plpgsql-description.html > > section 1.2.5.3, which explains how to execute dynamic queries. > At the end of this section there is an example with a comment: > > -- This works because we are not substituting any variables > -- Otherwise is would fail. > > And I need to know how can a query be executed substituting > variables. > > Thanks, --=20 Rajesh Kumar Mallah, Project Manager (Development) Infocom Network Limited, New Delhi phone: +91(11)6152172 (221) (L) ,9811255597 (M) Visit http://www.trade-india.com , India's Leading B2B eMarketplace.