Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Multiple counters (sequences?)
Hi !
Please help me resolve one problem.
I need generate unique number for primary key from several intervals.
From which interval is number taken depend on value another field.
Example:
Value of item Generate value from interval
1 100-200 2 0-50 3 500-700 4 2000-2999 5 3000-3099
My temporary solution is:
I created the table COUNTERS(ID,MIN,MAX,VALUE).
Contain of COUNTERS
ID MIN MAX VALUE
1 100 200 104 2 0 50 0 3 500 700 601 4 2000 2999 2111 5 3000 3099 3010
But this solution is good for concurrent using.
I know that is much better use Sequences. But i must create too many of them. The problem is how determinate which sequence to use.
Best "solution" would be a "array of sequences". But how this achieve?
Thanks for advices.
Honza Januska Received on Fri May 15 1998 - 09:09:41 CDT