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: Question: Use Trigger to Prevent Deletes with no Where Clause?

Re: Question: Use Trigger to Prevent Deletes with no Where Clause?

From: Noel <tbal_at_gie_o_2.pl>
Date: Sat, 15 Jan 2005 01:21:27 +0100
Message-ID: <cs9nea$4f2$1@inews.gazeta.pl>


Użytkownik xhoster_at_gmail.com napisał:

> Noel <tomekb_at_s_o_f_t_m_a_n.pl> wrote:
>
> <snip Tom's excellent post>
>

>>Both solution aren't good.
>>
>>I can put always-true condition in WHERE clause and i delete all rows.

>
>
> Yes, and I can put TNT in the data center and the archived backup storage
> center and delete all rows that way.

Well, i admit your sense of humor, but i wanted to point that Jesse wanted prevent to accidentaly delete ALL rows from table what might be coused by 'forgetting' WHERE clouse in DELETE statetment. Tom's suggested to search a delete statetment for a occurence of 'WHERE'in it.
Ok, i agree that might be acceptable, but like Murphy's rights says there is possible to produce a DELETE statetment with WHERE in it, and after that all rows migth be missing.
I don't say its simple 1=1 in WHERE, but it might be more complex. All i wanted to say is:
'Let Oracle delete rows' and let Oracle check what user has deleted, if all rows are missing then we rollback.

-- 
Noel
Received on Fri Jan 14 2005 - 18:21:27 CST

Original text of this message

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