X-Original-To: pgsql-hackers-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 59E2832A250 for ; Fri, 1 Oct 2004 12:46:01 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 56002-09 for ; Fri, 1 Oct 2004 11:45:54 +0000 (GMT) Received: from anchor-post-33.mail.demon.net (anchor-post-33.mail.demon.net [194.217.242.91]) by svr1.postgresql.org (Postfix) with ESMTP id AF7CC32A24F for ; Fri, 1 Oct 2004 12:45:57 +0100 (BST) Received: from mwynhau.demon.co.uk ([193.237.186.96] helo=mainbox.archonet.com) by anchor-post-33.mail.demon.net with esmtp (Exim 4.42) id 1CDLs3-000AHT-9g; Fri, 01 Oct 2004 11:46:43 +0000 Received: from [192.168.1.17] (client17.archonet.com [192.168.1.17]) by mainbox.archonet.com (Postfix) with ESMTP id 7528017506; Fri, 1 Oct 2004 12:45:54 +0100 (BST) Message-ID: <415D4372.8090303@archonet.com> Date: Fri, 01 Oct 2004 12:45:54 +0100 From: Richard Huxton User-Agent: Mozilla Thunderbird 0.7 (X11/20040615) X-Accept-Language: en-us, en MIME-Version: 1.0 Followup-To: pgsql-general@postgresql.org To: Johann Robette Cc: 'Russell Smith' , pgsql-hackers@postgresql.org Subject: Re: RE : Record unassigned yet References: <005f01c4a7a9$c8b80030$a5010a0a@Johann> In-Reply-To: <005f01c4a7a9$c8b80030$a5010a0a@Johann> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.3 tagged_above=0.0 required=5.0 tests=UPPERCASE_25_50 X-Spam-Level: X-Archive-Number: 200410/14 X-Sequence-Number: 59517 Johann Robette wrote: > Oh sorry about that! > No, I was alright in the syntax. Both are defined as current. > I can't find where the problem lies... The following works fine for me. === BEGIN test === DROP TABLE employees; CREATE TABLE employees (id integer, name text); COPY employees FROM stdin; 1 Aaron Aardvark 2 Betty Bee 3 Carl Cat \. CREATE OR REPLACE FUNCTION emp_test_fn() RETURNS boolean AS ' DECLARE current RECORD; Tmp integer; BEGIN FOR current IN SELECT * FROM employees LOOP Tmp := current.id; RAISE NOTICE ''tmp = %'', Tmp; END LOOP; RETURN true; END ' LANGUAGE 'plpgsql'; SELECT emp_test_fn(); === END test === PS - please reply to the -general list not -hackers. -- Richard Huxton Archonet Ltd