× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.




On 17/06/2010, at 2:10 AM, Dennis Lovelady wrote:

Is there really no way to tell SQL the order in which rows are to be
processed?

I was going to reply to one of your earlier appends but I thought the answer was implicit in some of the responses you received. Anyway, your statement is correct. There is no way to tell SQL to process input records in a particular sequence. You can control the sequence of the output records via ORDER BY but SQL reserves the right to decide how best to process the input. You can play silly buggers with syntax and perhaps get the desired result but that is more a side- effect and therefore may change with different releases, PTFs, or the current state of main store.

Since you seem to need the data in a particular sequence you could select the desired records and insert them into a temporary file. Use ORDER BY to ensure the sequence. Then process the temporary file such that a table scan is performed. I would expect simple RRN sequence to be applied in that case. Apply your running-total function to the query over the temporary file. The problem is that SQL could still decide to do things differently (e.g., build an index and process via that in some sequence it has determined is "better").

Or just do it without SQL i.e., native I/O. There are some things for which SQL is still unsuited.


Regards,
Simon Coulter.
--------------------------------------------------------------------
FlyByNight Software OS/400, i5/OS Technical Specialists

http://www.flybynight.com.au/
Phone: +61 2 6657 8251 Mobile: +61 0411 091 400 /"\
Fax: +61 2 6657 8251 \ /
X
ASCII Ribbon campaign against HTML E-Mail / \
--------------------------------------------------------------------




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.