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



At V5R3 IBM introduced implicit casting. This may be saving you at V5R4 and
having your query work fine. On V5R2 there is no implicit casting. Data
types have to match.

This reminds me of a recent email exchange I had with a lady from England.
QM query was working, leveraging implicit casting, but performing horribly.
This implicit data conversion was the culprit. Once she fixed all the
apostrophes, query performed in microseconds.

Elvis

Celebrating 10-Years of SQL Performance Excellence
http://centerfieldtechnology.com/training.asp

-----Original Message-----
Subject: RE: SQL works in iNav but not QMQRY

Thanks Elvis.

One thing I didn't mention was in our test system, which is V5R4, the QM
query works correctly. Our production system at V5R2 does not. The
command
strqmqry qmqry(imdmdcmpqm) setvar((DMD_C '001486') (DMD_P '001487'))
is correct. I think I need to start looking at group PTFs.


Loyd Goodbar
-----Original Message-----
Subject: RE: SQL works in iNav but not QMQRY

You're on the right track with apostrophes, this is always a problem
with QM
queries.

I use a trick learned from this list, namely replacing quotes with
another
parm. Let's say your qm query looks like this:

INSERT INTO yourLib/yourFile
SELECT * FROM yourLib/yourFile2
WHERE F1 = &q&DMD_C&q AND F2 = &q&DMD_P&q

Then your QM invocation would look like this:

STRQMQRY QMQRY(IMDMDCMPQM) SETVAR((DMD_C 001486) (DMD_P 001487) ('q'
''''))


Of course, you can effect this using many apostrophes in your CL, but
this
seems cleaner to me.

Elvis
-----Original Message-----
Subject: SQL works in iNav but not QMQRY

I've got a pretty long SQL statement that works in iSeries Navigator's
run SQL scripts, as well as in the 5250 STRSQL. However, it does not
work when compiled as a QMQRY. (We're using QM queries because we need
to pass a couple of parameters.)

Here are the messages I receive:

STRQMQRY QMQRY(IMDMDCMPQM) SETVAR((DMD_C 001486) (DMD_P 001487))

CONNECT to relational database S10297EC completed.

Current connection is to relational database S10297EC.

SET CONNECTION to relational database S10297EC completed.

Comparison operator = operands not compatible.

RUN QUERY command failed with SQLCODE -401.

RUN QUERY command ended due to error.

STRQMQRY command failed.

Connection to relational database S10297EC ended.

SQL cursors closed.



For the "comparison operator = operands not compatible," I receive no
additional information indicating which of several comparison operators
are in error. Also ran this variation, with the same (failing) results.

strqmqry qmqry(imdmdcmpqm) setvar((DMD_C '001486') (DMD_P '001487'))



Has anyone run into this and can provide some guidance? Again, the SQL
statement runs without error in iSeries Navigator and interactively via
STRSQL. Gives error when compiled as a QM query.



I can post the SQL if necessary but it's really long.



Thanks,

Loyd


As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.