Problem with Function and Trigger ! Urgent !!!

Поиск
Список
Период
Сортировка
От De Leeuw Guy
Тема Problem with Function and Trigger ! Urgent !!!
Дата
Msg-id 98kvcb$3k$1@news.tht.net
обсуждение исходный текст
Список pgsql-general
Hi all
I create this function and this trigger :
Before starting this, I start from the command prompt : createlang plpgsql
myDB

CREATE FUNCTION DelArtFather()
 RETURNS opaque
 AS '
  DELETE FROM TArticles WHERE IdArtFather = OLD.IdArt;
  RETURN OLD;
 '
 LANGUAGE 'plpgsql';

CREATE TRIGGER trigger_TArticles
 BEFORE DELETE ON TArticles
 FOR EACH ROW EXECUTE PROCEDURE DelArtFather();

And I execute the query :
DELETE FROM TArticles WHERE IdArt = 1;
I Receive :
NOTICE: plpgsql: ERROR during compile of delartfather near line 1
ERROR: parse error at or near "DELETE" occured !

Any Idee ?

Guy



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

Предыдущее
От: "Russell Hires"
Дата:
Сообщение: Re: Prompt question
Следующее
От: "De Leeuw Guy"
Дата:
Сообщение: Re: Create trigger problem :