Problem with delete trigger
Posted in 2003
Hi!
I've tried a trigger as:
create trigger "informix".deleteoperations delete on
"informix".operaciones referencing old as pre for each row (
execute procedure "informix".update_operations_balance(pre.cuentaorigen
,pre.cuentanum ,pre.cuentadc ,pre.idproducto
,pre.idoperacion,(pre.importe * -1.0000000000000000 ) ,pre.idtipoorden
));
create procedure update_operations_balance(ctaorigen varchar(3),ctanum varchar(9), ctadc varchar(2), aidproducto
varchar(12),aidoperacion int,aimp float,aidtipoorden varchar(10))
define impsigno float;
if (aidproducto=='0') then
select importe_segun_clase(clase,signo, aimp) into impsigno
from tiposordenes
where idtipoorden=aidtipoorden;
update operations
set saldo=saldo+impsigno
where cuentaorigen=ctaorigen
and cuentanum=ctanum
and cuentadc=ctadc
and idproducto=aidproducto
and idoperacion>aidoperacion;
end if
end procedure
When I run this code, I obtain the message error:
SQL Error (-747): Table or column matches object referenced in
triggering statement
Can you help me?