2

I am trying to create a trigger. It is supposed to update any new date entry 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;
/

1 Answer 1

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.