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

Home -> Community -> Usenet -> c.d.o.server -> Need Advice - Soft Deletes of Rows

Need Advice - Soft Deletes of Rows

From: Douglas White <ygi83_at_dial.pipex.com>
Date: Sun, 12 Jul 1998 01:02:28 +0100
Message-ID: <6o8uf2$jm5$1@flex.london.pipex.net>


I am a humble programmer programming a straight forward C/S system with Delphi 3 and Oracle 7.3. When a user deletes a row from a table I want the deletion to be a soft delete so that if they change their mind they can undo the delete and restore the row. The traditional way of doing this is to set up a flag field to indicate whether the row has been marked for deletion. I have two questions:

  1. Is there a smarter way of doing this in Oracle?
  2. If there isn't, how do you handle the case where the user wants to flag for deletion a row that has child rows (i.e. has rows that reference it in a foreign key)? I would not want to allow this, but how can I tell if a row has child rows before I try to delete it and Oracle raises an error message?

I would be very grateful for any advice anyone has on these issues!

Thanks

Doug White Received on Sat Jul 11 1998 - 19:02:28 CDT

Original text of this message

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