Reputation: 1
Code to move from one table to other upon deletion, is this correct?
create or replace TRIGGER Trans_history_s
AFTER DELETE
ON trans_s
REFERENCING NEW AS trans_s
FOR EACH ROW
BEGIN
INSERT INTO trans_history_s values (:old.book_no,:old.mem_no,sysdate,sysdate,sysdate);
END;
Upvotes: 0
Views: 23
Reputation: 717
Yes, this is correct and as @TonyAndrews has already stated, you should always explicitly define the columns you are referring to, to avoid relying on the column order.
Keep in mind that - though possible - you should never rely on the order of columns in a table. When adding columns, Oracle will always put these at the end.
Upvotes: 1