Difference between QM Query and traditional query

230 pts.
Tags:
Database Files
Query
Query Management Query
Query Manager
When both a QM Query and a traditional Query are run against a database file with IDENTICAL record selection, the traditional query returns more records. I can only guess that it has to do with a difference in the way each utility handles uncommitted data. It almost looks as if traditional Query "sees" uncommitted changes whereas Query Manager query does not. Can anyone verify this or offer more info on what's happening under the covers. It is a bit unsettling to see different data sets returned from two different i tools given the same selection criteria.  Thanks.

Answer Wiki

Thanks. We'll let you know when a new response is added.

An important difference in joining files exists between the two queries that just dawned on me. This was the cause of the QM query returning different data:

Where the traditional query is set up to join “matched records with primary file”, the QM query was defined as just a JOIN. When I changed the QM source to include a LEFT JOIN and moved the JOIN conditions up into the “– Tables” area, the join conditions between the queries matched and a run of each now returns equivalent data.

Thanks for looking. Any additional tips are welcome!

<b>QM BEFORE:</b>
<pre>
SELECT
– Columns
C.TEXT AS CONTACT, DATE(DIGITS(WBODT)) AS ORD_DATE, A.”TIME”, A.cust,
A.SQNBR, A.ORDCN, A.ITNBR, A.BLC, A.BPN, A.DESC, A.QTYO, A.UNETB,
QTYO * UNETB AS ENET, A.DFCTB, A.VDP, B.NSCD, B.QTYCS, MBAL – QTYCS
AS QTYW
– Tables
FROM “LIBx”/”file1″ A,
“LIBx”/”file2″ B,
“LIBy”/”file3″ C
– Row Selection
WHERE ((WBODT = &DATEIN)
AND (PROJECT = ‘PROJ1′)
AND (FIELD = ‘WUSER’))
– Join Conditions
AND (A.cust = B.cust)
AND (A.BLC = B.STKLC)
AND (A.BPN = B.STKPN) </pre>

<b>QM AFTER:</b>
<pre>
SELECT
– Columns
C.TEXT AS CONTACT, DATE(DIGITS(WBODT)) AS ORD_DATE, A.”TIME”, A.cust,
A.SQNBR, A.ORDCN, A.ITNBR, A.BLC, A.BPN, A.DESC, A.QTYO, A.UNETB,
QTYO * UNETB AS ENET, A.DFCTB, A.VDP, B.NSCD, B.QTYCS, MBAL – QTYCS
AS QTYW
– Tables
FROM “LIBx”/”file1″ A
LEFT JOIN “LIBx”/”file2″ B ON
(A.cust = B.cust)
AND (A.BLC = B.STKLC)
AND (A.BPN = B.STKPN)
JOIN “LIBy”/”file3″ C ON A.CD5 = C.”VALUE”
– Row Selection
WHERE (WBODT = &DATEIN AND PROJECT = ‘PROJ1′ AND FIELD = ‘WUSER’)
</pre>

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following