Logical Delete [message #192239] |
Mon, 11 September 2006 09:08 |
Xeneize
Messages: 6 Registered: September 2006
|
Junior Member |
|
|
Hi, I have a table with a flag (DELETE = YES / NO )
I need that every time i do a DELETE ..... FROM table WHERE ID..
the flag change to delete = YES on that id.
In postgres i can do this with a trigger on delete, set the flag on YES and then interrup the delete.
On Oracle I'm Getting an error because of muttating table.
How can i fix this problem in oracle?
Thank
|
|
|
Re: Logical Delete [message #192266 is a reply to message #192239] |
Mon, 11 September 2006 11:21 |
shoblock
Messages: 325 Registered: April 2004
|
Senior Member |
|
|
create a view on the table. create an INSTEAD OF trigger on the view - the trigger will do the update. have the users delete from the view, NOT THE TABLE.
|
|
|
|
Re: Logical Delete [message #192771 is a reply to message #192266] |
Wed, 13 September 2006 08:57 |
Xeneize
Messages: 6 Registered: September 2006
|
Junior Member |
|
|
shoblock wrote on Mon, 11 September 2006 11:21 | create a view on the table. create an INSTEAD OF trigger on the view - the trigger will do the update. have the users delete from the view, NOT THE TABLE.
|
Thankz, that works perfect.
|
|
|