首页 文章

使用编译错误创建的触发器:

提问于
浏览
-1

我每次尝试创建触发器时都会收到编译错误:请在下面找到问题陈述和代码:

问题陈述:创建一个名为'trigger_credit_bf_update'的触发器,每当credit_card表更新时触发该触发器 . 在更新credit_card详细信息之前,此触发器将cc_type和action插入到表'credit_card_log_history'中 . 受影响的日志表credit_card_log_history中的操作名称是'Before_Update_Credit_Card':我的代码链接此问题:

代码:在每行的credit_card上更新之前创建或替换触发器trigger_credit_bf_update; BEGIN插入credit_card_log_history(cc_type,action)值(:old.cc_type,'Before_Update_Credit_Card');结束;

1 回答

  • 0
    CREATE OR REPLACE TRIGGER  trigger_credit_bf_update
    BEFORE UPDATE ON credit_card 
    FOR EACH ROW
    BEGIN
    INSERT INTO credit_card_log_history (cc_type, action) Values 
    (:old.cc_type, 'Before_Update_Credit_Card');
    END;
    

相关问题