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: Michel Cadot <micadot{at}altern{dot}org>
Date: Mon, 18 Oct 2004 20:23:21 +0200
Message-ID: <41740964$0$29892$626a14ce@news.free.fr>

"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.

-- 
Regards
Michel Cadot
Received on Mon Oct 18 2004 - 13:23:21 CDT

Original text of this message

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