|
------------------------------
message: 2
date: Sat, 26 Jul 2008 00:13:35 -0400
from: Terrence Enger <tenger@xxxxxxxxxxxxxxxx>
subject: Re: SQL - RRN() not in order
Let me remind people--I confess, myself included--that if
you want
results in a specific order, you must specify that order
explicitly.
Even selecting from a keyed logical does not guarantee any
particular
sequence.
This is hard to remember because it so often happens that
the system
will choose a strategy which returns rows in the
"right" order by
accident. Sigh!
Cheers,
Terry.
On Fri, 2008-07-25 at 07:10 -0700, Luis Rodriguez wrote:
Hi List,least for me) results with SQL RRN:
Running some tests (V5R3) I found this strange (at
(FILE is a (DDS) file with no index and zero deletedrecords)
SQL decided to use an index (LF).
Select RRN(file) from FILE;
...........................
RRN ( file )
20
471
73
382
593
.
.
.
88
89
90
91
609
Select RRN(file), file.* from FILE;
..................................
RRN ( file ) (Fields...)
1 xxxxx
2 xxxxx
3 xxxxx
4 xxxxx
5 xxxxx
6 xxxxx
etc.
Even this sorts the output by RRN():
Select RRN(file) from FILE WHERE RRN(file) < 700;
Running the sentence under debug (STRDBG) shows that
Moreover, the selected index is a join file(3 Files!!)
My question is: Why does RRN() needs an index?.
I'm just curious why this is so.
This is not giving any problem for me right now,
Any ideas?
Regards,
Luis Rodriguez
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.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 on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.