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: Make table read-only

Re: Make table read-only

From: Howard J. Rogers <hjr_at_dizwell.com>
Date: Tue, 19 Oct 2004 04:59:27 +1000
Message-Id: <41741292$0$20129$afc38c87@news.optusnet.com.au>


"Michel Cadot" <micadot{at}altern{dot}org> wrote:

>
> "Ralf Zwanziger" <ralf_on_duty_at_gmx.de> a écrit dans le message de
> news:7n57n0t979rtkrvpcploqj7u37fqk9k6gu_at_4ax.com...

>> Is ist possible to make an oracle table read-only?
>> (without moving it to a read-only tablespace).
>> I haven't found any command like "alter table xxx read only" in the
>> docs.
>>
>> Bye,
>> Ralf
>>

>
> You can add a trigger before insert, update or delete that raise an error,
> something like:
>
> create or replace my_trigger
> before insert or update or delete on my_table
> begin
> raise_application_error (-20001,'Updating the table is not allowed');
> end;
> /
>
> This will work for all including the owner of the table.

Except of course thatinsert triggers don't fire if you are doing a direct load insert or a direct path SQL Loader load.

So yes, it's a good point, but it doesn't *necessarily* achieve what the user wanted.

Regards
HJR Received on Mon Oct 18 2004 - 13:59:27 CDT

Original text of this message

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