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
« March 2024 »
March
MoTuWeThFrSaSu
123
45678910
11121314151617
18192021222324
25262728293031