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



You have a couple options - do you want to create a table with the results? Or do you need to display them?

If a result table, and you are at 7.1, you can use the new RUNSQL command - it cannot do SELECTs directly.

With an older release and up, you can create a source member and use RUNSQLSTM.

I suggest forgetting about Query/400 - unless it's an already-existing one - and use QM queries. Those can have SQL statements - even SELECT. You can even take your Query/400 and convert it to a QM query, then add the distinct to the result there.

CRTSRCPF YOURLIB/QQMQRYSRC RCDLEN(91)

RTVQMQRY QRY400NAME YOURLIB/QQMQRYSRC (something like that - prompt the command)

Check the result for what you want - there are some odd things when converting to QMQRYs.

Open the source member you get and see a SELECT statement - add the DISTINCT as you need.

CRTQMQRY over that source member.

STRQMQRY to run it in CL - ba-da-boom!

HTH
Vern

On 7/2/2013 8:30 AM, Hoteltravelfundotcom wrote:
I have a ad hoc process, where I can make use of the DISTINCT feature of SQL

THe CL would first run query400 then I need the results as

Distinct.

Can you do that SQL statement in a CL?


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.