Re: Make columns read only

From: ddf <oratune_at_msn.com>
Date: Sat, 6 Nov 2010 13:12:16 -0700 (PDT)
Message-ID: <12009e89-ab74-4a0d-a8d9-84c8a7eab8e9_at_a4g2000prm.googlegroups.com>



On Nov 6, 1:14 pm, Ninja Li <nickli2..._at_gmail.com> wrote:
> Hi,
>
>   I would like to make certain columns in an Oracle table read only to
> prevent anyone from updating the values in these columns. I can think
> of creating trigger to issue error message whenever update occurs.
>
>   Are there better ways to do that? Your suggestions are appreciated.
>
>   Nick Li

I don't know of any; if you're using 10.2.0.x you could create a readonly  materialized view and if you're using 11.2 you can make the table read only. Of course making the entire table or materialized view read only doesn't solve your problem and Oracle hasn't yet provided a way (through, say, the ALTER TABLE statement) to make selected columns read-only. It would appear that a before insert trigger is the only option you have.

David Fitzjarrell Received on Sat Nov 06 2010 - 15:12:16 CDT

Original text of this message