MIDRANGE dot COM Mailing List Archive



Home » MIDRANGE-L » October 2011

Re: SQL Difference in V7 vs V6 not in memo to users



fixed

Jeff -

It would be helpful to see the full SQL statement which caused this error.

Perhaps if you qualified your field names in the SELECT statement by using the filename or a correlation name you probably would not get this error, or you would have discovered it the first time that you tried executing it...

Example:

Select A.Field1, A.Field2, B.Field3 from FileA A
join FileB B on A.Field1 = B.Field1

- sjl


Jeff wrote:
Hi All,
I just got bitten by this error today:

Message ID . . . . . . . . . :
SQL0338
Message file . . . . . . . . :
QSQLMSG
Library . . . . . . . . . :
QSYS
Message ID . . . . . . . . . : SQL0338
Message file . . . . . . . . : QSQLMSG
Library . . . . . . . . . : QSYS
Message text . . . . . . . . : JOIN predicate not valid.

V6R1

Message . . . . : JOIN predicate not valid.
Cause . . . . . : The JOIN predicate is not valid because a column is
specified that exists in a table that is outside the scope of the
join predicate.
The scope is generally determined from left to right but is
also based on the position of the join-condition. If parentheses are
used, columns inside the parentheses can not come from a table outside
the parentheses.

Recovery . . . : Do one of the following and try the request again:
-- Make certain that the column names, table names, and any qualifiers
are specified correctly.
-- Specify parentheses around joined tables to specify a join order
other than left to right. Ensure columns exist in tables that are in the
same scope.







Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2014 by MIDRANGE dot 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 here. If you have questions about this, please contact