Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id AF013475A6B for ; Sun, 26 May 2002 06:26:02 -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 F208D475960 for ; Sun, 26 May 2002 06:25:58 -0400 (EDT) Received: (qmail 9882 invoked from network); 26 May 2002 10:19:48 -0000 Received: from system29.trade-india-local.com (HELO server) (192.168.0.29) by ptil-236-129-del.primus-india.net with SMTP; 26 May 2002 10:19:48 -0000 Content-Type: text/plain; charset="iso-8859-1" From: "Rajesh Kumar Mallah." Organization: Infocom Network Limited. To: Gabriel Dovalo Carril , Jeff Eckermann Subject: Re: Functions with dynamic queries Date: Sun, 26 May 2002 15:55:59 +0530 X-Mailer: KMail [version 1.4] Cc: Lista SQL de postgres References: <20020524135106.99232.qmail@web20802.mail.yahoo.com> <3CEEE4A5.EF729BB@terra.es> In-Reply-To: <3CEEE4A5.EF729BB@terra.es> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200205261555.59986.mallah@trade-india.com> X-Archive-Number: 200205/274 X-Sequence-Number: 7909 Hi Gabriel, sorry for the late response, I tried both the scripts and they do work. psql -h 192.168.0.11 -U tradein test -f b.sql DROP psql:b.sql:6: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit inde= x 'people_pkey' for table 'people' CREATE INSERT 27856939 1 INSERT 27856940 1 DROP CREATE get_age --------- 10 (1 row) Hmm, am i missing anything ? mallah. Try attached scripts. They are only examples, (no real data) They are very, very simple and fails in the same situation. > The only difference between then is line 19 > > (func_error.sql) > Select people.age into person > > (func_nodata.sql) > Select max(people.age) as age into person > > > The first one returns: > ERROR: record person is unassigned yet > > And the second one: > get_age > --------- > > (1 > row) --=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.