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 -> Re: What is "sequence"?

Re: What is "sequence"?

From: Linda Wenzel <linda.wenzel_at_born.com>
Date: 1997/05/12
Message-ID: <01bc5ef0$5b138860$d34e49cc@train1.born.com>#1/1

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>...

> Hi
> Can any one please explain me what are "sequnces" ?
>
> Thanks
>
> Kirill
>
Received on Mon May 12 1997 - 00:00:00 CDT

Original text of this message

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