[英]table or view doesn't exist error
I'm using Oracle XE, in which i was making my own custom trigger. 我正在使用Oracle XE,在其中我做了自己的自定义触发器。 For that, I've made two tables INSERTED and ORDER_INFO in the SYSTEM schema, both have the same column name ORDER_ID, ORDER_DATE.
为此,我在SYSTEM模式中创建了两个表INSERTED和ORDER_INFO ,它们都具有相同的列名ORDER_ID,ORDER_DATE。 In my scenario, client will be placing his/her order then, order information will be stored into INSERTED table, then by using this trigger, it'll insert into another table ORDER_INFO after satisfying the condition.
在我的场景中,客户将下订单,然后将订单信息存储到INSERTED表中,然后使用此触发器,在满足条件后将其插入到另一个表ORDER_INFO中 。
this is what i got till now, 这就是我到现在为止
CREATE TRIGGER tri_check
AFTER INSERT ON inserted FOR EACH ROW
DECLARE
BEGIN
IF :new.order_date < (SYSDATE + 2)
THEN
RAISE_APPLICATION_ERROR(-20000, 'You cannot take an order to be delivered less than 2 days from now');
ELSE
INSERT INTO orders_info (order_id, order_date)
VALUES (:new.order_id, :new.order_date);
END IF;
END;
While executing the above query, i'm getting this error 执行上述查询时,出现此错误
ERROR at line 7: PL/SQL: ORA-00942: table or view does not exist
5. IF :new.order_date < (SYSDATE + 2)
6. THEN
7. RAISE_APPLICATION_ERROR(-20000, 'You cannot take an order to be delivered less than 2 days from now');
8. ELSE
9. INSERT INTO orders_info (order_id, order_date)
Need Help !! 需要帮忙 !!
It's because you do 因为你做
INSERT INTO orders_info
instead of 代替
INSERT INTO ORDER_INFO
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.