日期:2014-05-17  浏览次数:20730 次

急需一个触发器!!!!
以旅游景点优惠劵为例 更新优惠劵号使得优惠劵可以无限次使用
--激活一个单据的全部优惠券 YH101216000023可以替换成需要激活的单据编号
update token_billdetail set TOKENSTATUS =1,ACTIVITIME=sysdate where TOKENBILLNO='YH101216000023'
请给个触发器?能使优惠卷无限次使用

------解决方案--------------------
create or replace trigger tr 
after 
update of TOKENBILLNO on token_billdetail 
for each row
begin 
update token_billdetail set TOKENSTATUS =1,ACTIVITIME=sysdate where TOKENBILLNO=:old.tokenbillno; --'YH110513000020'
end;