Informix Error -8315: Sequence (%s) CURRVAL is not yet defined in this session.
Cause and resolution
Sequence (%s) CURRVAL is not yet defined in this session.
You cannot get the session CURRVAL because the sequence object has not been initialized in this session. The session CURRVAL is the value generated on a previous call to the sequence object's NEXTVAL.
If the sequence object has been renamed using RENAME SEQUENCE, you will need to reinitialize the sequence object in your session.
Run a NEXTVAL first to define a CURRVAL for the sequence object in your session.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-8315 fires when CURRVAL is referenced before the sequence has been initialized in the
current session — per the official guidance, CURRVAL is the value generated by a prior
NEXTVAL call in that session.
- No
NEXTVALcall yet made for the sequence in this session, per the official guidance — the direct, only cause. - The sequence was renamed via
RENAME SEQUENCE, per the official guidance — a specific, named contributing scenario requiring session reinitialization.
Solutions / Resolution
- Run a
NEXTVALfirst to define aCURRVALfor the sequence in your session, per the official guidance. - If the sequence was renamed, reinitialize it in your session, per the official
guidance, with a fresh
NEXTVAL.
Examples
Initializing CURRVAL
SELECT order_seq.NEXTVAL FROM systables WHERE tabid = 1;
SELECT order_seq.CURRVAL FROM systables WHERE tabid = 1;
Diagnostic Checks
- Check whether
NEXTVALhas been called for this sequence in the current session, and call it first if not (or if the sequence was recently renamed).
Related Errors / Related Topics
No closely related error codes are cross-referenced for -8315 in this set yet.
CURRVAL was referenced before NEXTVAL was ever called in this session — call NEXTVAL
first.