ORA-08002: sequence s%.CURRVAL is not yet defined in this session

来源:互联网 发布:淘宝爆款是什么 编辑:程序博客网 时间:2024/06/05 09:24
在工具中执行:

select  ar.ar_cash_receipt_history_s.currval from dual; 


出现错误:

ERROR at line 1:ORA-08002: sequence AR_CASH_RECEIPT_HISTORY_S.CURRVAL is not yet defined inthis session

这是因为在执行.CURRVAL前必须先执行.NEXTVAL, 所以修改SQL语句后可以这样来查询:

select ar_cash_receipt_history_s.nextval next_val,       ar_cash_receipt_history_s.currval cur_val  from dual;

官方说法:

ORA-08002: sequence string.CURRVAL is not yet defined in this session 
Cause: sequence CURRVAL has been selected before sequence NEXTVAL 
Action: select NEXTVAL from the sequence before selecting CURRVAL 

原创粉丝点击