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



I have a query I can get to work in STRSQL, but not getting it
to compile in SQLRPGLE...

the premise of the query is to return the latest instance of a user running a menu option. I have a menu file, and a menu log file.
for every menu file record I retrieve, I want to find the "Latest" time
the user ran that option...


I can't get my SQLRPGLE to accept the GROUP BY, or something else is wrong!!!

here is my SQL that works in STRSQL:
select mnuprf, mnugrp, mnuopt, mnucmd, mnuonm, max(mts) from
(select mnucmd, mnuprf, mnugrp,
mnuopt, mnuonm, mltimstmp as mts
from pdatalib/menupf
join pdatalib/menulog on mnuprf = mlnuprf and
mnugrp = mlnugrp and
mnuopt = mlnuopt
where mnucmd like ('%ORD500%')
order by mnuprf, mnugrp, mnuopt) as list1
group by mnuprf, mnugrp, mnuopt, mnucmd, mnuonm


here is my RPG that won't compile...
each of the fields in my outer select have a "Column XXXXXX or expression in SELECT list not valid" (SQL0122)

exec sql declare LOAD cursor for
select mnuprf, mnugrp, mnuopt, mnucmd, mnuonm, max(mts) from
(select mnucmd, mnuprf, mnugrp, mnuopt, mnuonm, mltimstmp as mts
from pdatalib/menupf
join pdatalib/menulog on mnuprf = mlnuprf and
mnugrp = mlnugrp and
mnuopt = mlnuopt
where mnucmd like (:fmtScanVals)
order by mnuprf, mnugrp, mnuopt)
ROWS for fetch only;


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.