Hello everyone,
I need to develop a procedure, which will need to use the next value of a sequence. Someone knows how to do this via SQL for:
1) Catch the NextVal of Sequence
2) Increase the value of sequence to
Thanks!
Encrement Sequence
- tiago_pimenta
- Rank: DBA Júnior
- Posts: 213
- Joined: Wed, 29 Jun 2011 9:49 am
- Location: Barretos / SP
Creates a sequence.
and then to pick up, just use the Select below.
Every time you run the SELECT above, it increments if Sequence.
and then to pick up, just use the Select below.
select sequence.nextval into sua_variavel from dual
- vitellozzi
- Rank: Programador Sênior
- Posts: 50
- Joined: Wed, 15 Sep 2010 9:53 am
- Location: Itatiba
Creating and increasing Sequence:
Creating an initial sequence 1:
Next value of a sequence: [[99 ]
Excluding sequence:
Creating a sequence starting from 100
Changing the value maximum sequence and increasing:
no longer,
Daniel Vitellozzi
Creating an initial sequence 1:
CREATE SEQUENCE SEQ_TESTE START WITH 1;
SELECT SEQ_TESTE.NEXTVAL FROM DUAL;
Excluding sequence:
DROP SEQUENCE SEQ_TESTE;
CREATE SEQUENCE SEQ_TESTE START WITH 100;
ALTER SEQUENCE SEQ_TESTE MAXVALUE 99999 INCREMENT BY 1 NOCYCLE NOCACHE;
Daniel Vitellozzi
-
- Information
-
Who is online
Users browsing this forum: No registered users and 16 guests