Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: What is "sequence"?
Kirill,
A sequence is just a sequential number generator.
You create one with the following syntax:
CREATE SEQUENCE test_sequence INCREMENT BY 1 START WITH 1 MAXVALUE 99999 CYCLE CACHE 10;
This tells Oracle that the sequence will start with the number 1, increase by 1 (1,2,3,...), and has a maximum value of 99999. Once the maximum value has been reached, CYCLE tells Oracle to start with 1 again. CACHE tells Oracle how many sequence numbers to keep in memory.
To use the sequence, you would use the following syntax:
SELECT test_sequence.NEXTVAL FROM DUAL;
This will get the next value from the sequence.
Linda
-- Linda Wenzel Born Information Services (612)404-4207 Kirill V. Florensky <airgeo_at_dol.ru> wrote in article <01bc5ec6$34743da0$8f1557c2_at_sa>...Received on Mon May 12 1997 - 00:00:00 CDT
> Hi
> Can any one please explain me what are "sequnces" ?
>
> Thanks
>
> Kirill
>
![]() |
![]() |