Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sequence on pl/sql

create sequence MYSEQ_sequence
start with 100
increment by 5;

I just created the sequence in sql. I want to create pl/sql anonymous block program unit that shows the curval, and nextval of the sequence MYSEQ. Does anybody know how to put it in pl/sql?

like image 716
p.ro Avatar asked Nov 27 '25 00:11

p.ro


1 Answers

A simple query will do:

SELECT MYSEQ_sequence.currval, MYSEQ_sequence.nextval
FROM DUAL

You don't even need a PL/SQL block for this.

like image 168
Gordon Linoff Avatar answered Nov 29 '25 22:11

Gordon Linoff



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!