Reputation: 63
i have additional table for saving history of edits. i want to do trigger for that and i need to save table name, where changes were made. how can i get a table name?
CREATE OR REPLACE TRIGGER DELDATA
AFTER DELETE
ON STUDENT
FOR EACH ROW
DECLARE
nextdata NUMBER;
BEGIN
SELECT sn.nextval into nextdata FROM DUAL d;
INSERT INTO STUDENTDEL(id, sn, TABLENAME)
values(:OLD.id, NEXTDATA, 'table_name');
END;
Upvotes: 1
Views: 79
Reputation: 63
no equivalent, because we can't use the same trigger for multiple table in Oracle
Upvotes: 1