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



My bad.
Paste error.
Should have been:
'SELECT NBCMP, NBMO, NBMOSQ, NBSEQ,
NBITEM, NBDSC1, NBLOC, NBUM, NBMODT, NBDUE, NBMQTY, NBCQTY, NBDQTY, NBCOR,
IFPLAN, NBDEL,COALESCE(RTHROUT,'' '')
FROM VMODETL, VINITMB
LEFT OUTER JOIN
FROHEAD ON NBCMP = RTHCMP
AND NBCOOR = RTHORD
AND NBCOBO = RTHBOCD
WHERE NBCMP = IFCOMP
AND NBLOC = IFLOC
AND NBITEM = IFITEM'


On Mon, Oct 3, 2011 at 4:40 PM, Mark Murphy/STAR BASE Consulting Inc. <
mmurphy@xxxxxxxxxxxxxxx> wrote:

This works on V6.1? There are two FROM clauses and the syntax of the
COALESCE doesn't appear to be correct.

Mark Murphy
STAR BASE Consulting, Inc.
mmurphy@xxxxxxxxxxxxxxx

-----midrange-l-bounces@xxxxxxxxxxxx wrote: -----
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
From: Jeff Young
Sent by: midrange-l-bounces@xxxxxxxxxxxx
Date: 10/03/2011 02:46PM
Subject: Re: SQL Difference in V7 vs V6 not in memo to users

'SELECT NBCMP, NBMO, NBMOSQ, NBSEQ,
NBITEM, NBDSC1, NBLOC, NBUM, NBMODT
NBDUE, NBMQTY, NBCQTY, NBDQTY, NBCOR, IFPLAN, NBDEL FROM VMODETL, VINITMB
COALESCE(RTHROUT,'' '') FROM
VMODETL JOIN VINITMB ON
NBCMP = IFCOMP
AND NBLOC = IFLOC
AND NBITEM = IFITEM
LEFT OUTER JOIN
FROHEAD ON NBCMP = RTHCMP-
AND NBCOOR = RTHORD
AND NBCOBO = RTHBOCD'
Where the fields with NB are in VMODETL, the fields with IF are in VINITMB
and the fields with RTH are in FROHEAD.
On V6R1, this statement works just fine,
On V7R1, it does not like the fields with "NB" on the Left Outer Join.
If I reverse the order of files VMODETL and VINITMB, it works just fine.


On Mon, Oct 3, 2011 at 2:04 PM, sjl <sjl_abc@xxxxxxxxxxx> wrote:

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.


--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.




--

Jeff Young
Sr. Programmer Analyst
--

This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.

--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.





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.