Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: forcing the developers to use sequences
"Gordon T. Wu" <wutao19_at_yahoo.com> a écrit dans le message 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');
>
>
>
Use a trigger.
-- AlkosReceived on Fri Dec 12 2003 - 10:02:10 CST