Re: Tigger after delete with plpgsql

From: Tulio <tulio(at)informidia(dot)com(dot)br>
To: Fellipe Henrique <fellipeh(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Tigger after delete with plpgsql
Date: 2012-08-31 18:04:15
Message-ID: 5040FC9F.9030302@informidia.com.br
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#333333">
Hi,<br>
<br>
You're using a trigger AFTER, in your case could be BEFORE?<br>
Cause when you use AFTER the var OLD not exists...<br>
I don't know if I understand exactly what you'll do to ativate this
trigger..<br>
but I think maybe is it..<br>
<br>
try..<br>
<br>
<br>
Em 31/08/2012 14:10, Fellipe Henrique escreveu:
<blockquote
cite="mid:CAF1jwZH+cXLCwHwZCF53eBtXADm=u4B_+6kQqJA9GfmctJ=Zaw(at)mail(dot)gmail(dot)com"
type="cite">Hello, I`m try to use this code for my After Delete
trigger:
<div><br>
</div>
<div>
<div>&nbsp; delete</div>
<div>&nbsp; from MOVIMENTO</div>
<div>&nbsp; where (IDEMPRESA = OLD.idempresa) and</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; (upper(TABELA) = 'NFENTRADA_ITEM') and</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; (CODIGO = OLD.idempresa_item);</div>
<div><br>
</div>
<div>But, when execute. show me error.. that`s says</div>
<div><br>
</div>
<div>"old is not initialize" (sorry,but I dont know how exactly
error msy because in my SO, give in portuguese)..</div>
<div><br>
</div>
<div>my question is: &nbsp;how can I use OLd and NEW in posgre?</div>
<div><br>
</div>
<div>Best Regards,</div>
<div><br>
</div>
<div><br>
</div>
<span style="color:black">T.&middot;.F</span><span style="color:black">.&middot;.A</span><span
style="color:black">.&middot;.</span>&nbsp;&nbsp;&nbsp;&nbsp; S+F<br>
<p style="height:17px;width:273px"><b><span style="color:black">Fellipe
Henrique P. Soares</span></b><span
style="font-size:7.5pt;color:rgb(102,102,102)" lang="EN-US"><br>
</span></p>
<p style="height:17px;width:273px"><b><span style="color:black">"Life
is a game without Tutorial"</span></b></p>
<p style="height:17px;width:273px"><font face="garamond, serif"><b><a
moz-do-not-send="true" href="http://fellipeh.eti.br"
target="_blank">http://fellipeh.eti.br</a></b></font></p>
</div>
</blockquote>
<br>
</body>
</html>

Attachment Content-Type Size
unknown_filename text/html 2.3 KB

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Fellipe Henrique 2012-08-31 18:14:15 Re: Tigger after delete with plpgsql
Previous Message Alan Hodgson 2012-08-31 18:00:53 Re: Tigger after delete with plpgsql