2
DiscanX
8y

Wanna get the next value of a sequence in Oracle? Oh just do :
SELECT sequence_name.NEXTVAL FROM DUAL

Wanna get the current value instead? Try this query :
SELECT last_number FROM all_sequences WHERE sequence_owner = '<sequence owner>' AND sequence_name = '<sequence_name>';

Yeah thanks Oracle...

Comments
  • 0
    Are you sure of what you're doing? Sequences are made to be read once for each value, you shouldn't have to read the current value!
Add Comment