before delete trigger to make backup of deleted data
I had a relatively simple question. Let's assume I have the following tables...
create table hello (
x varchar(30),
y varchar(30),
z int);
I've created a duplicate table
create table hello_deleted_data (
x varchar(30),
y varchar(30),
z int);
"hello" is my main table. But when a user deletes a row, I want to store it in "hello_deleted_data" so I can retrieve deleted data if it was deleted erroneously (and then purge it later).
Logically this seems like I can put something in a "before delete" trigger, but am unable to derive the proper syntax from the examples I've seen. Could someone help me out?
create trigger hellox before delete on hello
insert into hello_deleted_data (x,y,z)
values (???.x, ???.y, ???.z); <-- ??
Much appreciated,
John Simons
Edited 1 time(s). Last edit at 05/10/2006 11:49AM by John Simons.
Subject
Views
Written By
Posted
before delete trigger to make backup of deleted data
17498
May 10, 2006 11:48AM
6666
May 10, 2006 12:29PM
7443
May 10, 2006 12:37PM
6647
May 10, 2006 02:46PM
7179
May 10, 2006 02:57PM
4744
January 29, 2008 05:59AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.