Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: How to protect primary keys?
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
![]() |
![]() |