Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Question: Use Trigger to Prevent Deletes with no Where Clause?
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.
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.
-- NoelReceived on Fri Jan 14 2005 - 18:21:27 CST