MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Left Outer Join SQL Query Error

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
rajeev5174
Beginner


Joined: 05 Jun 2007
Posts: 25
Topics: 10

PostPosted: Tue May 29, 2012 11:16 am    Post subject: Left Outer Join SQL Query Error Reply with quote

Hi,

The below query when i am trying to execute is giving error of -199, please some one let me know where the issue is.


Code:

SELECT NAT_ID,TERM_DATE,EMPLOY_STAT_CODE FROM TABLE AS
(SELECT  NAT_ID,TERM_DATE,EMPLOY_STAT_CODE
FROM PDGBLASC.V3_WIN_ASC_NID_US
WHERE LENGTH(RTRIM(NAT_ID)) < 5
AND STR_CTRY_CODE = 'CA' ) AS TABLE1
LEFT OUTER JOIN ASTE_ID_T ON SUBSTR(DIGITS(ASC_SS_NR),2,8)=
TABLE1.NAT_ID WITH UR;

Thanks,
Raj
Back to top
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Tue May 29, 2012 11:25 am    Post subject: Reply with quote

sigh (picked that up from kolusu)

the -199 tells you have a misplaced keyword - what and where.

since you decided to provide only your sql (somewhat unreadable, correctable with code tags)

you are still stuck with solving the problem yourself.

the issue is your not bothering to look up the sql code description and recommended solution.

nothing we can do to help.
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
papadi
Supermod


Joined: 20 Oct 2009
Posts: 594
Topics: 1

PostPosted: Tue May 29, 2012 3:47 pm    Post subject: Reply with quote

You SELECT . . . . FROM TABLE, but nothing is defined as TABLE . . .

Or my eyes are selectively failing . . . Smile
_________________
All the best,

di
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Tue May 29, 2012 4:43 pm    Post subject: Reply with quote

rajeev5174,

I added code tags to your post that it is readable. And here is a link for the detailed explanation of the error -199

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/dsnmcj12/2.3.77?

Also take a look at the example 15 which shows how an left outer join is done


dbzTHEdinosauer wrote:
sigh (picked that up from kolusu)


Bad influences ? Hmm I better set a better example. Embarassed
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
rajeev5174
Beginner


Joined: 05 Jun 2007
Posts: 25
Topics: 10

PostPosted: Wed May 30, 2012 11:18 am    Post subject: Reply with quote

Thanks Kolusu for the info the query is corrected.
Thanks,
Raj
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group