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



Thanks for your suggestion, Neill. We will try including an ORDER BY clause after the GROUP BY clause to sort the data.

It will take some time to test this, however as we will have to promote it to our QA environment (paperwork, etc...).

_The odd thing is, this query works on the SQL command line (STRSQL) on both DEV and QA as well as from the web service in WAS on our development box. It just does not return the data sorted as desired from the web service in WAS on QA.

Thank you for your suggestion...we'll let you know how it goes.

Mike


-------------------------------------------------------------------------------------

message: 7

date: Fri, 1 May 2009 22:38:19 +0100

from: "Neill Harper" <neill.harper@xxxxxxxx>

subject: RE: SQL works from green screen, but not in WAS with JDBC...



Ahh I see to be fair you have stated that you want ascending order.. .sorry

:-)



This might help.



Unlike the ORDER BY clause, the GROUP BY clause does not order data. Include

an ORDER BY clause after your GROUP BY clause if you want to sort data in a

particular order or sort on an aggregate in the projection list.





-----Original Message-----

From: java400-l-bounces@xxxxxxxxxxxx [mailto:java400-l-bounces@xxxxxxxxxxxx]

On Behalf Of Mike Burdette

Sent: 01 May 2009 22:02

To: java400-l@xxxxxxxxxxxx

Subject: SQL works from green screen, but not in WAS with JDBC...



All:



We have an issue where an SQL statement from a Java application (web

service) running in WAS Express 6.1, JDK 1.5, returns different results

than when the statement is run in the green screen using STRSQL on the same

iSeries. The statement runs correctly from green screen. To complicate the

matter, the statement will run on another WAS Express 6.0 App server, using

JDK 1.4, as well as on the green screen for this iSeries.



Here is the statement:



SELECT FLD2, FLD3, MIN(MINFLD) AS MINFLD, FROM LIB.FILENAME where ....

GROUP BY MINFLD, FLD2, FLD3, ... fetch first 100 rows only (statement has

been altered to change the field names and for brevity).



The GROUP BY does not seem to work on the 6.1 server. We want the records

returned in ascending order by MINFLD.



Any thoughts would be appreciated.



Thanks


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.