Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Need a delete trigger that tracks deletes.

RE: Need a delete trigger that tracks deletes.

From: <tday6_at_csc.com>
Date: Tue, 19 Mar 2002 05:28:20 -0800
Message-ID: <F001.0042CE98.20020319052820@fatcity.com>

I'd also add a date/time stamp and the Oracle userid of the deleter. Heck, why not also journal inserts and updates? Or maybe you can get all this from logminer.

                                                                                           
                    Kevin Lange                                                            
                    <kgel                To:     Multiple recipients of list ORACLE-L      
                    @ppoone.com>         <ORACLE-L_at_fatcity.com>                            
                    Sent by: root        cc:                                               
                                         Subject:     RE: Need a delete trigger that       
                                         tracks deletes.                                   
                    03/18/2002                                                             
                    05:43 PM                                                               
                    Please                                                                 
                    respond to                                                             
                    ORACLE-L                                                               
                                                                                           
                                                                                           




Why not simply a Before Delete trigger that copies the row about to be deleted over to a duplicate table. This way you can know exactly what the data was before it was deleted. Of course, if you only care about a certain field or group of fields you can always just copy those fields instead of all fields.

-----Original Message-----

Sent: Monday, March 18, 2002 4:18 PM
To: Multiple recipients of list ORACLE-L

We need to be able to track what records have been deleted from a table.

Our current thinking is
1. A "before delete" trigger, that stores a unique ID of the all the data in
the table.
2. A "after delete" trigger, which gets the records left in the table. 3. Subtract the two lists to find the records that have been deleted.

This appears to be cumbersome, is there anyway to do this with one trigger ?

Thanks

Darren



Darren Browett P.Eng                               This message
was transmitted
Data Administrator                            using 100%
recycled electrons
Information and Communication Technology City of Coquitlam
P:(604)927 - 3614
E:dbrowett_at_city.coquitlam.bc.ca

--

Please see the official ORACLE-L FAQ: http://www.orafaq.com
--

Author: Browett, Darren
  INET: dbrowett_at_city.coquitlam.bc.ca

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists

--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
--

Please see the official ORACLE-L FAQ: http://www.orafaq.com
--

Author: Kevin Lange
  INET: kgel_at_ppoone.com
Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists

--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).

--

Please see the official ORACLE-L FAQ: http://www.orafaq.com
--

Author:
  INET: tday6_at_csc.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists

--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). Received on Tue Mar 19 2002 - 07:28:20 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US