- 论坛徽章:
- 0
|
有谁写过 trigger 插入的,我写了一个 怎么不能通过啊 。
着急
这是 从 center 拷贝出来的
- This script has been created using ^ as the termination character.
-- If you wish to execute this script through the CLP, you will need
-- to add the CLP option -td"^" to your command line, for example:
-- db2 -td"^" -f filename.ddl
CONNECT TO SDDATA^
CREATE TRIGGER DB2ADMIN.TI_CARD_ACCT AFTER INSERT ON DB2ADMIN.CARD_ACCT REFERENCING NEW AS newamount NEW_TABLE AS temp_card_acct FOR EACH ROW MODE DB2SQL
WHEN ( newamount = 0)
insert into temp_card_acct(no_card,amt,date_sys)
select no_card,sum(amount) as amt,max(date_sys) as date_sys
from card_acct
group by no_card;
END^
CONNECT RESET^ |
|