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 -> Re: Need Advice - Soft Deletes of Rows

Re: Need Advice - Soft Deletes of Rows

From: Andrea Mattioli <amattioli_at_gedy.it>
Date: Sun, 12 Jul 1998 07:35:15 GMT
Message-ID: <35a865e6.2588431@news.flashnet.it>


On Sun, 12 Jul 1998 01:02:28 +0100, "Douglas White" <ygi83_at_dial.pipex.com> wrote:

>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
>
>

Use "Transactions" !
Every change you do on a table Oracle is not definitive until you "commit" it.
If users change their made you can "rollback" your changes. Check oracle manuals for correct use of "commit" and "rollback" SQL commands.
You can find a good explanations in
"Oracle 7 Server Application Developer's Guide" in the chapter called
"Processing SQL Statements"

Bye

Andrea Mattioli amattioli_at_gedy.it Received on Sun Jul 12 1998 - 02:35:15 CDT

Original text of this message

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