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: How to protect primary keys?

Re: How to protect primary keys?

From: Sybrand Bakker <postmaster_at_sybrandb.demon.nl>
Date: Tue, 14 Dec 1999 20:21:59 +0100
Message-ID: <945199372.3740.0.pluto.d4ee154e@news.demon.nl>


You can grant update on column basis, but that's going to be a cumbersome operation, as you need to include ALL columns except those belonging to the PK
A different solution is to write update triggers as follows

not_allowed_to_update exception;
begin
if :new.pk <> :old.pk
then

   raise not_allowed_to_update;
end if;
exception
 when not_allowed_to_update

    dbms_output.put_line('You are not allowd to update'); end;
AFAIK know the rollback is implied in the latter case.

Hth,

--
Sybrand Bakker, Oracle DBA
jfguyard <jfguyard_at_swissonline.ch> wrote in message news:pxw54.13888$Mg.224512_at_c01read03-admin.service.talkway.com...
> Starting to work with Oracle 8 I wonder how primary keys can be
> protected?
> Update operations must be prohibited.
>
> Any idea?
>
> Thanks in advance and best regards.
> --
> Free audio & video emails, greeting cards and forums
> Talkway - http://www.talkway.com - Talk more ways (sm)
>
Received on Tue Dec 14 1999 - 13:21:59 CST

Original text of this message

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