本文介绍了为什么此触发器失败?说的是无效的标识符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
CREATE MATERIALIZED VIEW ORDERS_MV
BUILD IMMEDIATE
REFRESH COMPLETE ON DEMAND AS
SELECT * FROM ORDERS;
---------------------------------------
CREATE OR REPLACE TRIGGER update_ship_receive
INSTEAD OF INSERT ON ORDERS_MV
FOR EACH ROW
BEGIN
UPDATE ORDERS SET EXPECTED_SHIP_DATE = ORDER_DATE+5;
UPDATE ORDERS SET EXPECTED_RECEIVE_DATE = SHIP_DATE+1
WHERE SHIPPING_METHOD = '1 DAY';
UPDATE ORDERS SET EXPECTED_RECEIVE_DATE = SHIP_DATE+2
WHERE SHIPPING_METHOD = '2 DAY';
UPDATE ORDERS SET EXPECTED_RECEIVE_DATE = SHIP_DATE+5
WHERE SHIPPING_METHOD = 'GROUND';
END;
/
推荐答案
Oracle可以查看您的表结构.我们不能.我敢打赌,Oracle在您的代码中看到了问题.
Oracle can see your table structures. We can't. I'm betting Oracle sees the problem in your code.
它应指向出现错误的第一行.如果不是,请从user_errors中选择*;
It should point to the first line with the error. If not, select * from user_errors;
也许您的ORDERS表没有SHIP_DATE(因为第一条语句谈到EXPECTED_SHIP_DATE).
Maybe your ORDERS table doesn't have SHIP_DATE (since the first statement talks about EXPECTED_SHIP_DATE).
这篇关于为什么此触发器失败?说的是无效的标识符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!