Re: Create trigger problem :

From: "Mark G(dot) Gilmore" <mgilmore(at)pobox(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Create trigger problem :
Date: 2001-03-12 16:17:54
Message-ID: 98isoh$2irm$1@news.tht.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Stephan Szabo 2001-03-12 16:26:08 Re: Delete Cascade
Previous Message Renaud Tthonnart 2001-03-12 16:14:25 Re: Counting elements of an array