posts - 13,  comments - 5,  trackbacks - 0
My trigger example:
CREATE OR REPLACE TRIGGER InventoryOthersMstrUpdate
BEFORE INSERT OR UPDATE  ON INVENTORY_OTHERS_MSTR
FOR EACH ROW
BEGIN
  IF (:NEW.TOTL_LEFT<>:OLD.TOTL_LEFT
     OR :NEW.TOTL_QTY<>:OLD.TOTL_QTY
  OR :NEW.TOTL_RESERVED<>:OLD.TOTL_RESERVED
  OR :NEW.HCARE_RESERVED_QTY<>:OLD.HCARE_RESERVED_QTY)
  THEN INSERT INTO INVENTORY_OTHERS_MSTR_TRACE (OTHERS_MSTR_ID, CATALOGUE_MSTR_ID, LAST_UPDATED_BY, LAST_UPDATED_ON, LAST_UPDATED_AT, CHECK_IND, LOCK_IND, LOC_IND, MAINTAIN_QTY, TOTL_QTY, TOTL_RESERVED, TOTL_LEFT, TOTL_LOAN, HCARE_RESERVED_QTY, LOC_ID)
  VALUES (:OLD.OTHERS_MSTR_ID, :OLD.CATALOGUE_MSTR_ID,
          :OLD.LAST_UPDATED_BY, :OLD.LAST_UPDATED_ON,
    :OLD.LAST_UPDATED_AT, :OLD.CHECK_IND, :OLD.LOCK_IND, :OLD.LOC_IND, :OLD.MAINTAIN_QTY, :OLD.TOTL_QTY, :OLD.TOTL_RESERVED, :OLD.TOTL_LEFT, :OLD.TOTL_LOAN, :OLD.HCARE_RESERVED_QTY, :OLD.LOC_ID);
  END IF;
END;
/

参考:http://www.chinaunix.net/jh/21/21696.html
posted on 2006-11-16 18:06 snbna 阅读(160) 评论(0)  编辑  收藏 所属分类: Java的世界

只有注册用户登录后才能发表评论。


网站导航:
 
<2006年11月>
2930311234
567891011
12131415161718
19202122232425
262728293012
3456789

常用链接

留言簿(4)

随笔分类(13)

随笔档案(13)

文章分类

范冰冰

搜索

  •  

积分与排名

  • 积分 - 4102
  • 排名 - 3273

最新评论

阅读排行榜

评论排行榜