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



Vernon,

I did some checking in the manuals, and found my answer.

quoted from "DB2 for AS/400 Query Management"

"Some of the functions that can be specified and saved in a QRYDFN object
cannot be transformed into query-management-supported SAA functions, and
some cannot be precisely transformed.
<snip?
The ANZQRY command provides analysis in the form of messages and on-line
help information that suggest ways of dealing with transformation problems.
"

and in another chapter, explains what it does with joins:

"If any join tests exist, they are used to start the WHERE clause, and any
record selection tests are added using the AND operator. "

My guess is... when joining more than 2 files, there would be no direct sql
equivelent to qry/400 join option 3.  so I guess that's why it just throws
the join out and makes it a "where".  I ran ANZQRY and that's just what it
said it did - ignored the join type.

obviously, not a perfect command, AND it didn't give me any warnings when I
ran it.   It would be nice if it could return the proper join type if there
were only 2 files.  oh well.

thanks anyway,

rick



---original message---
From: Vernon Hamberg <vhamberg@attbi.com>

Looks wrong to me. What's your vxrxmx?

At 08:11 AM 3/8/02 -0500, you wrote:
>Hey all,
>
>I created a qry/400 query, joining two files (option 3=Unmatched records
>with primary file).   I saved the query and did a RTVQMQRY to see what the
>sql statement should look like.
>
>what I got was a simple join:
>
>SELECT
>   ALL       T01.ORG, T01.VENID, T01.ORIGORG
>             T01.INVOICE
>   FROM      M30DAP/VOL0 T01,
>             M30DAP/VOH0 T02
>   WHERE     T01.ORG = T02.ORG
>     AND     T01.VENID = T02.VENID
>     AND     T01.ORIGORG = T02.ORIGORG
>     AND     T01.VCHNBR = T02.VCHNBR
>
>shouldn't this have been a 'left outer join'?  I ran the SQL statement and
>got completely different results than the first.  What gives?
>
>I'm on V4R5.
>
>Thanks!
>
>Rick



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.