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在您的代码中看到了问题。
它应指向出现错误的第一行。如果不是,请从user_errors中选择;否则,请选择。
也许您的ORDERS表没有SHIP_DATE(因为第一条语句谈到EXPECTED_SHIP_DATE)。