How to before delete trigger???
Posted in 2013
Topics: Stored Procedures & SPL, Triggers, Constraints & Referential Integrity
Hi good morning, I have the following problem I need to make a trigger but I
run a stored procedure before delete.
with this syntax you run with it after delete:
CREATE TRIGGER informix.datadec_mensaje_marcas_delete delete on"informix".submarca referencing old as post
for each row( execute procedure
"informix".p_insert_datadec_mensaje_marcas(post.marca,post.codigo,26 ))
I tried to before delete but I get syntax error.
What would be the correct syntax to do a before delete?.
Thanks in advance.
Marcos:
A BEFORE (or AFTER) trigger event happens only once BEFORE (or AFTER) any
rows are deleted/updated/inserted, so you cannot use the references to
"new" and/or "old" within those events. These BEFORE and AFTER event
actions cannot be execute for each row affected.
CREATE TRIGGER informix.datadec_mensaje_marcas_delete delete on"informix".submarca referencing old as post
fBEFORE ( execute procedure
"informix".p_insert_datadec_mensaje_marcas( 26 ));
Art
Art S. Kagel
Advanced DataTools (www.advancedatatools.com)
Blog: http://informix-myview.blogspot.com/
Disclaimer: Please keep in mind that my own opinions are my own opinions
and do not reflect on my employer, Advanced DataTools, the IIUG, nor any
other organization with which I am associated either explicitly,
implicitly, or by inference. Neither do those opinions reflect those of
other individuals affiliated with any entity with which I am affiliated nor
those of the entities themselves.
On Wed, Jun 26, 2013 at 4:58 AM, MARCOS CRESPO RIPOLL <
marcos.crespo@serpis.com> wrote:
> Hi good morning, I have the following problem I need to make a trigger but
> I
> run a stored procedure before delete.
>
> with this syntax you run with it after delete:
>
> CREATE TRIGGER informix.datadec_mensaje_marcas_delete delete on> "informix".submarca referencing old as post
>
> for each row( execute procedure
> "informix".p_insert_datadec_mensaje_marcas(post.marca,post.codigo,26 ))
>
> I tried to before delete but I get syntax error.
> What would be the correct syntax to do a before delete?.
> Thanks in advance.
>
>
>
>
*******************************************************************************
> Forum Note: Use "Reply" to post a response in the discussion forum.
>
>
--001a11c365a6b69bc804e00c5bad