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



Maybe try this - RTVQMQRY of the QMQRY that works into a source member, then copy/paste that into STRSQL and see whether it works. If not, I'd say there's a bug. As you probably know, with your experience, you can't prompt this common-table expression stuff in iether STRSQL or STRQM, so they are kind of 'way behind.

Alternatively, although it seems you have the library list thing covered, maybe try debug in all three situations (you can turn on debug in the recent ODBC drivers, as I recall) and check secon-level for differences, maybe some freak thing is happening with what actual files are selected.

HTH
Vern

At 01:28 PM 12/23/2003 -0500, you wrote:
The following SQL statement works fine from the Ops-Nav "Run SQl Statements"
and as a Query Manager SQL query.  But when run from the STRSQL screen, it
returns no records yet it doesn't give any error message either.

Note that the QM query and the STRSQL are done interactively from the same
job, so it isn't a problem with different files being used.

I'm guessing STRSQL has a problem with the common-table expression or the
correlated sub-query.

Has anyone seen this before?

Thanks,
Charles

with tbl as (select pimodl, piiall, dochdt
             from mason/mppriv, mason/tpdocu
             where pimodl = domelc and dochdt >= 20031223
             group by pimodl, piiall, dochdt
             order by pimodl, dochdt asc)

select tbl.pimodl, tbl.piiall, tbl.dochdt, (piiall -
        (select sum(b.doqty)
            from mason/tpdocu b
            where b.domelc = tbl.pimodl
              and b.dochdt between 20031223 and tbl.dochdt
          ))  as EndingQty
from tbl
order by 1, 3 asc



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.