-
I would like to create a sequence to automatically generate primary key values for a table.
Can I confine a sequence to be used only for one table and not any other? Also can I prevent it from skipping values when storing in one table.
e.g. I would like all values from 1 till 5 to be stored in a table as a primary key; and don't want it to be like 1,3,4,5.
-
You choose the way that the sequence is used. So, if you only want one column to be driven from your sequence, that is your option.
You can populate your primary key with the sequence using nextval, currval etc. If you increment the sequence and then rollback or you delete rows, then there will be gaps.
David Knight
OCP DBA 8i, 9i, 10g
-
also the aging out of cached sequence values from SGA may cause gaps.
Sanjay
-
if perforamnce is not a big issue , nocache option can solve the aging problem.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|