× 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.



To all the good ppl on the list ...
-
Answer from Luis Rodriguez:
"your "outer" SELECT does not have an ORDER BY clause (and, of course, being a view it can't have one), so the output sequence can't be assured."
That makes sense. Thank you for pointing it out.

=========
Answer from Rob:
"The ORDER BY and FETCH FIRST clauses may not be specified except within a common-table expression.
http://pic.dhe.ibm.com/infocenter/iseries/v7r1m0/topic/db2/rbafzhcview.htm "
Thanks for the explanation and the link. It was very helpful. Example 6 at the link reinforced what you wrote.

=========
Answer from John Yeung
"To run with that for a bit: There are plenty of ways to generate Excel directly on the i" .
What method would you recommend? What have you tried and which method do you favor?

=========
What I did to resolve my problem....
With the new knowledge gained from all of you, I know realize that a view can't have an order.
So I followed example 6 and used the newly created view to insert records into a physical file. The insert can have an order by clause. Then I download the physical and order is maintained.
Not a great solution, but it will work for now.

Here's the SQL ...
insert into qgpl/filePF
(f1file,f1mbr,f1mbrname,f1lib,f2file,f2mbr,f2mbrname,f2lib)
select
f1file,f1mbr,f1mbrname,f1lib,f2file,f2mbr,f2mbrname,f2lib
from qgpl/viewAB
order by coalesce (f1lib,f2lib), coalesce(f1file,f2file), coalesce(f1mbrname,f2mbrname)

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.