October 5, 2014 at 5:33 pm
Hello, I am trying to validate this syntax below in winsql against a db2 on an as/400. I get the message that shows up in the subject line above. Not sure how to get around this. Any suggestions would greatly be appreciated.
SELECT
A."CCUST" AS "CUSTOMER_NO",
A."CNME" AS "CUSTOMER_NM",
B."CTDESC" AS "CUSTOMER_GROUP_NM",
C."SNAME" AS "CUSTOMER_CAT15_DESC",
D."TMDESC" AS "TERMS DESCRIPTION",
E.CCCODE AS ZCC_CODE
FROM
ERPLXF."RCM" A
JOIN ERPLXF."RCT" B on B."CTCOMP"=A."CCOMP" AND B."CTCSTP"=A."CTYPE" AND B."CTCURR" = A."CCURR"
JOIN ERPLXF."SSM" C on C."SSAL" = A."CSAL"
JOIN ERPLXF."RTM" D and D."TMTERM"=A."CTERM" and D."TMCMPN" = A."CCOMP"
LEFT OUTER JOIN ERPLXF."ZCC" E ON E."CCCODE"=A."CREF01"
WHERE
A."CCUST" <> 0 and E."CCID" = 'CC' and E."CCTABL" = 'SCRF1'
October 6, 2014 at 12:37 am
The SQL syntax looks fine to me.
What if you tried a DB2 forum, since this is probably a DB2 specific error?
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
October 6, 2014 at 3:58 am
Looks to me like an error in the query:
SELECT
A."CCUST" AS "CUSTOMER_NO",
A."CNME" AS "CUSTOMER_NM",
B."CTDESC" AS "CUSTOMER_GROUP_NM",
C."SNAME" AS "CUSTOMER_CAT15_DESC",
D."TMDESC" AS "TERMS DESCRIPTION",
E.CCCODE AS ZCC_CODE
FROM
ERPLXF."RCM" A
JOIN ERPLXF."RCT" B on B."CTCOMP"=A."CCOMP" AND B."CTCSTP"=A."CTYPE" AND B."CTCURR" = A."CCURR"
JOIN ERPLXF."SSM" C on C."SSAL" = A."CSAL"
JOIN ERPLXF."RTM" D and ON D."TMTERM"=A."CTERM" and D."TMCMPN" = A."CCOMP"
LEFT OUTER JOIN ERPLXF."ZCC" E ON E."CCCODE"=A."CREF01"
WHERE
A."CCUST" <> 0 and E."CCID" = 'CC' and E."CCTABL" = 'SCRF1'
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
October 6, 2014 at 4:02 am
ChrisM@Work (10/6/2014)
Looks to me like an error in the query:...
Good catch.
And that's why we use the SQL formatting people π
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
October 6, 2014 at 4:06 am
Koen Verbeeck (10/6/2014)
ChrisM@Work (10/6/2014)
Looks to me like an error in the query:...
Good catch.
And that's why we use the SQL formatting people π
+1
Our little team's working with DB2. If you think MS error messages can be misleading, you should see the stuff IBM throws at you. No wonder the OP was confused;-)
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
October 6, 2014 at 4:07 am
ChrisM@Work (10/6/2014)
Koen Verbeeck (10/6/2014)
ChrisM@Work (10/6/2014)
Looks to me like an error in the query:...
Good catch.
And that's why we use the SQL formatting people π
+1
Our little team's working with DB2. If you think MS error messages can be misleading, you should see the stuff IBM throws at you. No wonder the OP was confused;-)
Indeed. I'd expect a syntax error.
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
October 6, 2014 at 8:34 am
Thanks everyone for their help!
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply