Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: Read only access to a table except for some fields

Re: Read only access to a table except for some fields

From: Eugenio <eugenio.spadafora_nospam_at_compaq.com>
Date: 2000/06/14
Message-ID: <8i7i7f$8tg$1@mailint03.im.hou.compaq.com>#1/1

If you need to use all the table's columns (read) you can also grant update privilege to the user only for updateable columns

Example from SQL reference manual (+ something)

GRANT SELECT, REFERENCES (empno), UPDATE (empno, sal, comm) ON scott.emp
TO blake;

blacke will be able to select all the columns of scott.emp, he will be able to create foreign key on his tables referencing the column empno of scott.emp,
and he will able to modify empno, sal, comm on scott.emp

--
be happy

Eugenio
remove _nospam from reply address

Opinions are mine and do not necessarily reflect those of my company

=======================================================
Jens Meihoefer wrote in message <8i7hh2$a82$1_at_news.online.de>...

>
>ekrem <nospam_at_dot.com> schrieb in im Newsbeitrag:
>GiG15.20626$c5.35519_at_newsfeeds.bigpond.com...
>> how do I give an oracle (8.15i) user read only access to a table *except*
>> for a couple fields within that table which the user has to be able
>> to change the values.
>>
>> thanks in advance.
>>
>> cheers,
>> ekrem
>
>I know 2 ways to solve your problem:
>1.
>create a view on the table that contains only the columns that are
>updatable.
>grant the update privilege only on the view and not on the table.
>
>2.
>create a "before update for each row trigger" , that sets (depending on the
>user) the :new value to the :old value for the columns that are not allowed
>to be changed.
>
>hth
>Jens (J.Meihoefer_at_BITS-on-the.net )
>http://www.BITS-on-the.net
>
>
Received on Wed Jun 14 2000 - 00:00:00 CDT

Original text of this message

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