Stored Procedure Problem

Поиск
Список
Период
Сортировка
От Mike Marconi
Тема Stored Procedure Problem
Дата
Msg-id 20020523191006.69817.qmail@web21503.mail.yahoo.com
обсуждение исходный текст
Ответы Re: Stored Procedure Problem  (Jan Wieck <janwieck@yahoo.com>)
Список pgsql-general
I set up my database to include lang plpgsql.
When trying to create this simple stored procedure and
trigger below, the procedure is created but the
trigger fails.
the error returned is

"psql:importPageDataFunction:25: ERROR:
CreateTrigger: function pagedata_insert() does not
exist".

 CREATE FUNCTION pagedata_insert
(integer,integer,integer,integer,integer,integer,integer)
RETURNS opaque AS '

    DECLARE
        g ALIAS FOR $1;
        z ALIAS FOR $2;
        t ALIAS FOR $3;
        p ALIAS FOR $4;
        r ALIAS FOR $5;
        s ALIAS FOR $6;
        temp ALIAS FOR $7;
    BEGIN
        IF tempid IS NULL THEN
            tempid := (SELECT template FROM signs WHERE id =
sid);
        END IF;

        INSERT INTO pagedata (gid, zid, tid, page, rid, sid,
tempid) VALUES (g, z, t, p, r, s, temp);

        RETURN NULL;
    END;

' LANGUAGE 'plpgsql';

CREATE TRIGGER insertpagedata BEFORE INSERT
    ON pagedata FOR EACH ROW EXECUTE
PROCEDURE pagedata_insert (gid, zid, tid, page, rid,
sid, tempid);

I have notice that the procedure is in pg_proc, but if
you refer to it with "Drop Function pagedata_insert"
it won't find it either.
If I take out the argument declaration both objects
are created successfully.

thanks in advance

Mike Marconi

__________________________________________________
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
http://launch.yahoo.com

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

Предыдущее
От: "Joel Burton"
Дата:
Сообщение: Re: Violation of NOT NULL
Следующее
От: Niclas Gustafsson
Дата:
Сообщение: Indices for both where and order by.