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
---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]