Use Oracle Trigger To Create A Mirror Of A Record Before Delete. (Doc ID 353196.1)

Last updated on JULY 05, 2017

Applies to:

PL/SQL - Version: 10.2
Information in this document applies to any platform.

Goal

Can a DELETE trigger be created to fit the following criteria:
- copy all the fields from Table A to Table B.
- be dynamic so if Table A changes to add new fields or delete existing fields, the trigger would not have to be modified

According to Microsoft this could be accomplished in SQL server with this code:
CREATE TRIGGER savedel
ON titleauthor
FOR DELETE
AS
INSERT del_save
SELECT * FROM deleted;

Does something like this exist within Oracle?

Solution

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms