Tigger after delete with plpgsql

From: Fellipe Henrique <fellipeh(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Tigger after delete with plpgsql
Date: 2012-08-31 17:10:47
Message-ID: CAF1jwZH+cXLCwHwZCF53eBtXADm=u4B_+6kQqJA9GfmctJ=Zaw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello, I`m try to use this code for my After Delete trigger:

delete
from MOVIMENTO
where (IDEMPRESA = OLD.idempresa) and
(upper(TABELA) = 'NFENTRADA_ITEM') and
(CODIGO = OLD.idempresa_item);

But, when execute. show me error.. that`s says

"old is not initialize" (sorry,but I dont know how exactly error msy
because in my SO, give in portuguese)..

my question is: how can I use OLd and NEW in posgre?

Best Regards,

T.·.F.·.A.·. S+F

*Fellipe Henrique P. Soares*

*"Life is a game without Tutorial"*

*http://fellipeh.eti.br*

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Grzegorz Tańczyk 2012-08-31 17:51:51 Re: Refreshing functional index
Previous Message John Lumby 2012-08-31 15:32:17 RE: [GENERAL] UPDATE RULE to be invoked when UPDATE .. WHERE fails the WHERE predicate ?‏