pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Richard Huxton <dev@archonet.com>
To: Johann Robette <jrobette@onyme.com>
Cc: Russell Smith <mr-russ@pws.com.au>
Cc: pgsql-hackers@postgresql.org
Subject: Re: RE : Record unassigned yet
Date: Fri, 01 Oct 2004 12:45:54 +0100
Message-ID: <415D4372.8090303@archonet.com> (raw)
In-Reply-To: <005f01c4a7a9$c8b80030$a5010a0a@Johann>
References: <005f01c4a7a9$c8b80030$a5010a0a@Johann>

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



view thread (3+ messages)  latest in thread

Message-ID: <415D4372.8090303@archonet.com>
Permalink:  ../415D4372.8090303@archonet.com/
Also on:    postgresql.org/message-id/415D4372.8090303@archonet.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: dev@archonet.com, jrobette@onyme.com, mr-russ@pws.com.au, pgsql-hackers@postgresql.org
  Subject: Re: Record unassigned yet
  In-Reply-To: <415D4372.8090303@archonet.com>
  References: <005f01c4a7a9$c8b80030$a5010a0a@Johann> <415D4372.8090303@archonet.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox