Personal tools
You are here: Home Les outils logiciels SGBD Oracle Oracle - How increment a sequence
Log in


Forgot your password?
 

Oracle - How increment a sequence

2 way ::

1) by changing the increment value 

select <Sequence_Name>.nextval from dual;

 

Example

 

select SEQ_ABONNEMENT.nextval from dual;

The sequence is incremented by 1 unit.

 

Pour avancer un sequenceur :

Modifier la valeur increment du sequenceur

alter sequence SEQ_ABONNEMENT increment by <integer>;

Exemple

alter sequence SEQ_ABONNEMENT increment by 10;


2) by looping an increment

 

To obtain a sequence of the next 10 values, use the CONNECT BY levelclause, as shown:

SELECT 
   catalog_seq.NEXTVAL 
FROM 
   dual
CONNECT BY level <= 10;

 

 

The next 10 values get output:

 

source : https://blog.toadworld.com/oracle-create-sequence-explained-with-examples

 

Document Actions
« April 2024 »
April
MoTuWeThFrSaSu
1234567
891011121314
15161718192021
22232425262728
2930