Re: Executing more than once procedure from trigger
Posted in 1997
Partha Dutta <pdutta@fcmc.com> replied to Nagesh Daliparthy thus :-
Nagesh Daliparthy wrote:
>
> How to call more than one procedure from an informix trigger using
for each > row?
In the stored procedure, just call other stored procedures.
This solution will work fine, except, of course that any other
processes that call the first procedure will then execute the embedded
procedures. Possible what Nagesh was after was along these lines :-
-- tr_mstrn_ins.sql
drop trigger tr_mftrn_ins;
create trigger tr_mftrn_ins insert on mftrn
referencing new as inserted
for each row
when (inserted.mftrn_manfac in("PURF","FREIS")
and inserted.mftrn_orderno matches "GR*"
and inserted.mftrn_opno matches "6*"
and inserted.mftrn_opno <> "60"
and (inserted.mftrn_goodinc+inserted.mftrn_scrapinc) > 0
and inserted.mftrn_opstatus <> "H")
(execute procedure
pr_gen_pu12(inserted.mftrn_orderno,inserted.mftrn_
serial,inserted.mftrn_scrapinc)),
when (inserted.mftrn_manfac in("PURF","FREIS")
and inserted.mftrn_orderno matches "GR*"
and inserted.mftrn_opno matches "6*"
and inserted.mftrn_opno <> "60"
and inserted.mftrn_opstatus = "H")
(execute procedure
pr_gen_oracle(inserted.mftrn_orderno,inserted.mftr
n_opno))
As can be seen, this trigger executes two procedures dependent upon
the triggering condition.
Regards
Glyn Balmer
glynb@bicceri.demon.co.uk