Re: Create trigger problem :

From: "De Leeuw Guy" <G(dot)De_Leeuw(at)eurofer(dot)be>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Create trigger problem :
Date: 2001-03-12 17:39:36
Message-ID: 98j201$2k0l$1@news.tht.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I try also this solution, but i receive the error :
CURRENT : used in non-rule query
CreateTrigger: function delartfather() does not exist

CREATE FUNCTION DelArtFather()
RETURNS INT4
AS '
DELETE FROM TArticles WHERE IdArtFather = OLD.IdArt;
SELECT 1 AS ignore_this
'
LANGUAGE 'sql';

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

Guy

"Mark G. Gilmore" <mgilmore(at)pobox(dot)com> a crit dans le message news:
98isoh$2irm$1(at)news(dot)tht(dot)net(dot)(dot)(dot)
> Instead of sending old.ldArt in as a parameter, try just referencing old
> inside the function body.
> So the function then has no argument.
>
> Mark
>
>
>
> "De Leeuw Guy" <G(dot)De_Leeuw(at)eurofer(dot)be> wrote in message
> news:98imbv$2hk2$1(at)news(dot)tht(dot)net(dot)(dot)(dot)
> > Hi all,
> >
> > I try this :
> >
> > CREATE FUNCTION DelArtFather(INT4)
> >
> > RETURNS INT4
> >
> > AS '
> >
> > DELETE FROM TArticles WHERE IdArtFather = $1;
> >
> > SELECT 1 AS ignore_this
> >
> > '
> >
> > LANGUAGE 'sql';
> >
> > CREATE TRIGGER trigger_TArticles
> >
> > BEFORE DELETE ON TArticles
> >
> > FOR EACH ROW EXECUTE PROCEDURE DelArtFather(old.IdArt);
> >
> > and i obtain this error :
> >
> > ERROR: parse error at or near "old"
> >
> > How can i correct my command ??
> >
> > Thanks in advance
> >
> > Guy De Leeuw
> >
> >
> >
>
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message The Hermit Hacker 2001-03-12 18:19:18 Re: Postgresql.org website search
Previous Message Christian Marschalek 2001-03-12 17:38:49 Comipling error plz help