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: Vitalis Pedrotti via OracleMonster.com <forum_at_OracleMonster.com>
Date: Fri, 14 Jan 2005 12:30:43 GMT
Message-ID: <a4e5e33c3b904fedac85feb779ebaf61@OracleMonster.com>


It's an interesting trick to know!

But let's hope the OP won't use this script without modification if the name of his table contains the string "where" =)

SQL> rename t to aMadCowThere;

Table renamed.

SQL> delete from aMadCowThere;
delete from aMadCowThere

            *
ERROR at line 1:

ORA-20000: you totally lose
ORA-06512: at "SCOTT.T_TRIGGER", line 14
ORA-04088: error during execution of trigger 'SCOTT.T_TRIGGER'


SQL> rename aMadCowThere to aMadCowHere;

Table renamed.

SQL> delete from aMadCowHere;

7 rows deleted.

Vitalis

-- 
Message posted via http://www.oraclemonster.com
Received on Fri Jan 14 2005 - 06:30:43 CST

Original text of this message

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