flex_grigorowicz
flex_grigorowicz

Reputation: 63

how to get table name

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

Answers (1)

flex_grigorowicz
flex_grigorowicz

Reputation: 63

no equivalent, because we can't use the same trigger for multiple table in Oracle

Upvotes: 1

Related Questions