Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Multiple counters (sequences?)

Multiple counters (sequences?)

From: Jan Januska <J.Januska_at_sh.cvut.cz>
Date: Fri, 15 May 1998 16:09:41 +0200
Message-ID: <355C4CA5.6092@sh.cvut.cz>


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

Original text of this message

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