Home » RDBMS Server » Server Administration » How to use Trigger move record from one table to another table?
How to use Trigger move record from one table to another table? [message #374131] Sat, 26 May 2001 19:41 Go to next message
Mon
Messages: 7
Registered: May 2001
Junior Member
I want trigger example to move record from one table to another table by check from specific field
example

table ALLUSER have field (ID,NAME,SURNAME,STATUS)
when I update field STATUS to "D" it mean user dead
trigger will remove that record from table ALLUSER and insert into table DEADUSER
and when I update STATUS to "I" it mean user inactive
trigger will remove that record from table ALLUSER and insert into table INACTIVEUSER

Thanks
Re: How to use Trigger move record from one table to another table? [message #374132 is a reply to message #374131] Sun, 27 May 2001 23:22 Go to previous message
Sarada
Messages: 27
Registered: April 2001
Junior Member
Hi,

I don't think you can achieve that in the Trigger since you cannot access/manipulate the record in the trigger body from which it was triggered(Hope I am not confusing u). Hence what you can do is, just do the code for your business logic in the Trigger and then eod of the day (create a job) to remove the unwanted records.

Trigger example

create or replace trigger
after insert or update or delete on
for each row
declare
begin
<put in u r code here>
.
.
.
.
end;
/

HTH

Orashark
Previous Topic: How to use Trigger move record from one table to another table?
Next Topic: Sending email from PL/SQL
Goto Forum:
  


Current Time: Wed Jul 03 16:45:17 CDT 2024