Re: RE : Record unassigned yet

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: RE : Record unassigned yet
Дата
Msg-id 415D4372.8090303@archonet.com
обсуждение исходный текст
Ответ на RE : Record unassigned yet  ("Johann Robette" <jrobette@onyme.com>)
Список pgsql-hackers
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;
ENDLOOP;    RETURN true;
 
END
'
LANGUAGE 'plpgsql';

SELECT emp_test_fn();
=== END test ===

PS - please reply to the -general list not -hackers.

--   Richard Huxton  Archonet Ltd


В списке pgsql-hackers по дате отправления:

Предыдущее
От: "Johann Robette"
Дата:
Сообщение: RE : Record unassigned yet
Следующее
От: "Marc G. Fournier"
Дата:
Сообщение: Re: CREATE INDEX speeds up query on 31 row table ...