1. Part 3- DROP sequence
NEXTVAL, CURRVAL
1DR. GIRIJA NARASIMHAN
2. SQL> Drop sequence seq1 ;
Sequence dropped.
SQL> select seq1.nextval, seq1.currval from dual;
NEXTVAL CURRVAL
------------- ---------------
1 1
The Oracle NEXTVAL function is used to retrieve the next value in a
sequence. The Oracle NEXTVAL function must be called before calling
the CURRVAL function, or an error will be thrown. No current value
exists for the sequence until the Oracle NEXVAL function has been
called at least once.
2
DR. GIRIJA NARASIMHAN
3. SQL> create sequence seq1
2 start with 8
3 increment by -2
4 maxvalue 8
5 minvalue 0
6 cycle
7 nocache;
Sequence created.
SQL> select seq1.CURRVAL from dual;
select seq1.CURRVAL from dual
*
ERROR at line 1:
ORA-08002: sequence SEQ1.CURRVAL is not yet defined in this session
SQL> select seq1.nextval S from dual;
S
----------
8
SQL> select seq1.CURRVAL from dual;
CURRVAL
----------
8
3DR. GIRIJA NARASIMHAN