PL/SQL question

Поиск
Список
Период
Сортировка
От Froggy / Froggy Corp.
Тема PL/SQL question
Дата
Msg-id 40857F26.D724C7E0@froggycorp.com
обсуждение исходный текст
Ответы Re: PL/SQL question  (Stephan Szabo <sszabo@megazone.bigpanda.com>)
Список pgsql-general
Hello everyone,

    I try to see if i can make a recursive function with a trigger set on
INSERT and doing an insert under my trigger function.

    So i wrote a test function :


CREATE OR REPLACE FUNCTION testfunc() RETURNS SETOF RECORD AS '
DECLARE
    use_t RECORD;
BEGIN

    SELECT INTO use_t id_categorie FROM categorie ORDER BY id_categorie
DESC;
    IF use_t.id_categorie<>50 THEN
        INSERT INTO categorie (nom) VALUES (''test'');
    END IF;

    RETURN NULL;

END;
'LANGUAGE plpgsql;


The problem is that i can't exec this function to test it, psql return
the following error :

"ERROR:  set-valued function called in context that cannot accept a set"

But my INSERT INTO works if i write it directly.

Someone get an idea ?

Thx in advance,
regards,

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

Предыдущее
От: Bob.Henkel@hartfordlife.com
Дата:
Сообщение: Re: Postgresql system requirements to support large
Следующее
От: "Dann Corbit"
Дата:
Сообщение: Re: Downgrading from Postgresql 7.4 to 7.1