开发者

How to set new date entries to current date?

开发者 https://www.devze.com 2023-02-11 14:41 出处:网络
I am trying to create a trigger. It is supposed to update any new date ent开发者_如何转开发ry to sysdate. So far, I have the following code. However, I get \"invalid table name\" and \"SQL statement i

I am trying to create a trigger. It is supposed to update any new date ent开发者_如何转开发ry to sysdate. So far, I have the following code. However, I get "invalid table name" and "SQL statement ignored" errors.

CREATE OR REPLACE TRIGGER new_orders
AFTER INSERT ON orders
FOR EACH ROW
BEGIN
    IF INSERTING THEN
       UPDATE
           SET order_date := SYSDATE;
    END IF;
END;
/


CREATE OR REPLACE TRIGGER new_orders
BEFORE INSERT ON orders
FOR EACH ROW
BEGIN
    :NEW.order_date := SYSDATE;
END;
/
0

精彩评论

暂无评论...
验证码 换一张
取 消