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: forcing the developers to use sequences

Re: forcing the developers to use sequences

From: Syltrem <syltremzulu_at_videotron.ca>
Date: Fri, 12 Dec 2003 11:26:35 -0500
Message-ID: <DXlCb.6952$G1.32047@tor-nn1.netcom.ca>


You can create a trigger AFTER INSERT on the table. This way, any value set by a program can be overridden by the trigger. That`s the best way to do it but it does not remove the need to educate programmers...

-- 
Syltrem

OpenVMS 7.3-1 + Oracle 8.1.7.4
http://pages.infinit.net/syltrem (OpenVMS related web site, en français)
---zulu is not in my email address---
"Gordon T. Wu" <wutao19_at_yahoo.com> a écrit dans le message de
news:qwlCb.402$Er.31529_at_mencken.net.nih.gov...

> In Oracle 9i2, is there a way to attach a sequence to a field so that
people
> have to use the sequence during insertion operations?
>
> Say,
>
> create table test (id number(38), name varchar2(20);
> create sequence id_seq no cycle nomaxvalue;
>
> Is there a way to force the developers to use the sequence when inserting
a
> new record?
> insert into test (id, name) values (id_seq.nextval, 'xyz');
>
>
>
Received on Fri Dec 12 2003 - 10:26:35 CST

Original text of this message

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