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

解决方案 »

  1.   

    没看明白,  你先看看触发器的定义。    把想要操作的表名 , 以及表名以什么条件触发 , 是update,insert ,delete  以及触发的时候要执行什么的操作。 触发器在执行之中是不允许修改本表的。 只允许查询本表,而且需要用到自治事务。
      

  2.   

    就是给出上面update 的触发器
      

  3.   

    1.update token_billdetail set TOKENSTATUS =1,ACTIVITIME=sysdate where TOKENBILLNO='YH110513000020'2.create or replace trigger tr after insert or update or delete
    on token_billdetail
    begin  
    if updating then  
    dbms_output.put_line('update');
    end if;
    if inserting then
    dbms_output.put_line('insert');
    end;执行了一下说无效触发器
      

  4.   

    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;
      

  5.   

    我自己修改了一点:create or replace trigger tr
    after
    update of TOKENBILLNO on token_billdetail
    begin
      update token_billdetail set TOKENSTATUS =1,ACTIVITIME=sysdate  where TOKENBILLNO='YH110809000032';
    end;