to create trigger

to create trigger

 

  

CREATE TRIGGER DB2ADMIN.DEL_PROD_PART_DTL AFTER DELETE ON
DB2ADMIN.TB_PROD_ORD_PART_DTL REFERENCING OLD AS OLD FOR EACH ROW
MODE DB2SQL
BEGIN ATOMIC
update tb_order_dtl set prod_ord_qty = coalesce (prod_ord_qty, 0) -
OLD.prod_ord_qty
where (order_type, order_yr, order_no) in (select
order_type, order_yr, order_no
from tb_prod_ord_hdr where prod_ord_year = OLD.prod_ord_year
and
prod_ord_no = OLD.prod_ord_no) and mat_code = OLD.mat_code;
END

When I try to create the above trigger from control center command
editor then error raises as "The command was processed as an SQL
statement because it was not a valid Command Line Processor command."

How can I create this trigger?


By
Vijaykumar.g

DB2 & UDB email list listserv db2-l LazyDBA home page