Sequence ora-8002 error for every connection. [message #626453] |
Tue, 28 October 2014 03:11 |
pradies
Messages: 250 Registered: May 2008
|
Senior Member |
|
|
Hi,
I am using sequence in Oracle 12c on linux within schema sngadmin and given grant to etos_user.
CREATE SEQUENCE SNGADMIN.TEST
START WITH 1
MAXVALUE 1000
MINVALUE 1
NOCYCLE
NOCACHE
NOORDER
NOKEEP
GLOBAL;
GRANT SELECT ON SNGADMIN.TEST TO ETOS_USER;
When selecting from sngadmin sequence within schema its asking for nextval before every currval for every connection.
04:05:19 nsatvznp[SNGADMIN]> connect sngadmin
Enter password:
Connected.
04:05:32 nsatvznp[SNGADMIN]>
04:05:32 nsatvznp[SNGADMIN]> select sngadmin.test.currval from dual;
select sngadmin.test.currval from dual
*
ERROR at line 1:
ORA-08002: sequence TEST.CURRVAL is not yet defined in this session
Elapsed: 00:00:00.00
04:05:39 nsatvznp[SNGADMIN]> select sngadmin.test.nextval from dual;
NEXTVAL
----------
1
Elapsed: 00:00:00.01
04:05:52 nsatvznp[SNGADMIN]> select sngadmin.test.currval from dual;
CURRVAL
----------
1
Elapsed: 00:00:00.00
04:06:07 nsatvznp[SNGADMIN]> disconnect
Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
04:06:18 nsatvznp[SNGADMIN]> connect sngadmin
Enter password:
Connected.
04:06:35 nsatvznp[SNGADMIN]>
04:06:35 nsatvznp[SNGADMIN]> select sngadmin.test.currval from dual;
select sngadmin.test.currval from dual
*
ERROR at line 1:
ORA-08002: sequence TEST.CURRVAL is not yet defined in this session
Elapsed: 00:00:00.01
04:06:40 nsatvznp[SNGADMIN]>
if for some reason I need to know only what is the currval is for sequence, how Can we get that w/o running nextval.
Thanks.
|
|
|
|
|