Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Sequence
Hello,
we have got the following problem:
there are several tables with primary keys named "nr" (NUMBER) and we are looking for a automatized generation of that primary key.
We have tried to do that by a sequence,
CREATE SEQUENCE SetNR INCREMENT BY 1 MINVALUE 1 NOMAXVALUE NOCACHE; INSERT cust (NR, NAME) VALUES (SetNr.NextVal, 'TestName');
But that statement return eachtime it runs a global new number, so we
loose a lot of
dbspace.
Who knows how to solve that problem via a sequence or a trigger (on insert).
Thanks,
Andreas
Received on Tue Jun 08 1999 - 07:25:24 CDT