Problem with Function and Trigger ! Urgent !!!

From: "De Leeuw Guy" <G(dot)De_Leeuw(at)eurofer(dot)be>
To: pgsql-general(at)postgresql(dot)org
Subject: Problem with Function and Trigger ! Urgent !!!
Date: 2001-03-13 11:06:22
Message-ID: 98kvcb$3k$1@news.tht.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Browse pgsql-general by date

  From Date Subject
Next Message The Hermit Hacker 2001-03-13 11:27:21 Re: postgresql to mysql conversion?
Previous Message Oliver Elphick 2001-03-13 10:53:17 Re: Is this a bug in 7.1?