Sequential database retrieval allows an NCL procedure to maintain any number of concurrent sequential retrieval paths into an NDB.
Each path is in one of the following four states:
Note: Any further forward gets will continue to receive the EOF response (assuming the sequence was defined with KEEP=YES. If not, further gets of any kind would receive an error response).
Note: Any further backward gets will continue to get the EOF response, subject to the previous comments.
When at an EOF, a get in the opposite direction will reset the EOF and recommence the sequence.
The first &NDBBGET after a sequence is defined, or after a RESET with no REPOS=/RID= sets the correct end to start from (front if FWD, back if BWD).
An &NDBSEQ RESET REPOS=value with a value outside the defined range will set the relevant EOF, or position to the first (or last) record in the range, depending on the direction of the next &NDBGET.
Note: Sequences have an implicit forward direction of ascending key field or RID values. For this reason, the nominated TO value must not be less than the nominated FROM value. To retrieve records in descending sequence, the &NDBGET DIR=BWD option is used.
| Copyright © 2009 CA. All rights reserved. |
|