I have this SQL script i my app:
select my_seq.nextval from dual connect by level <= 100;
It works great but once I saw (in logs) that it returned no rows at all. Value of sequence is quite far from maximum. I wonder how is it possible at all.
Sequence creation script:
CREATE SEQUENCE my_seq
MINVALUE 1 MAXVALUE 999999999999999999999999999
INCREMENT BY 1 START WITH 3602281
CACHE 2000 NOORDER NOCYCLE;
There is a small possibility that your DUAL table is empty or that you have a local DUAL table? Try:
select 1 from dual;
If no rows then try:
select 1 from sys.dual;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With