I am using this trigger to keep a copy of the deleted record from table
Orders_Details in table
I am using this trigger for two reason first one is security in case the record accidentally deleted and to keep history of deleted record by user
Is there any better way ?
CREATE OR REPLACE TRIGGER TRG_Record_Deleted BEFORE DELETE ON Orders_Details FOR EACH ROW BEGIN INSERT INTO Orders_Details_Deleted SELECT * FROM Orders_Details WHERE Orders_Details.Order_ID = Orders_Details.Order_ID; END;