How can the oracle retrieve the current value of a sequence?

In Oracle database, you can retrieve the current value of a sequence using the following SQL statement:

SELECT sequence_name.CURRVAL FROM dual;

In which, sequence_name is the name of the sequence from which the current value is to be obtained. It is important to note that this statement can only fetch the correct current value after the NEXTVAL of the sequence has already been called.

bannerAds