I agree (and am very conscious of) with the fact that the only way to
guarantee a result ordered is with the ORDER BY clause.
That said, what I don't really understand is SQL using an index for reporting the RRN(). One would imagine that kind of things would be better doing a table scan.
Terrence Enger wrote:
Let me remind people--I confess, myself included--that if
you want results in a specific order, you must specify that order
Luis Rodriguez wrote:
Running some tests (V5R3) I found this strange (at least for me)
results with SQL RRN: (FILE is a (DDS) file with no index and
zero deleted records) Select RRN(file) from FILE;
<<SNIP unordered SELECT RRN(A) vs ordered SELECT RRN(A),A.* >>
Running the sentence under debug (STRDBG) shows that SQL decided
to use an index (LF). My question is: Why does RRN() needs an
index?. Moreover, the selected index is a join file(3 Files!!) This is not giving any problem for me right now, I'm just curious
why this is so. Any ideas?
This mailing list archive is Copyright 1997-2013 by MIDRANGE dot COM and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available here. If you have questions about this, please contact