IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Need to understand SQLCODE = 12


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rohanthengal

Active User


Joined: 19 Mar 2009
Posts: 206
Location: Globe, India

PostPosted: Thu Nov 05, 2015 11:22 am
Reply with quote

I have written below SQL to find out accounts from TAB A which are present in TAB B and TAB C. I am getting my expected result but getting warning in SPUFI with SQLCODE = 12. So, just wondering whats the exact meaning of it and why i am getting this error.

Code:
SELECT PRFX,ACCT,SFX         
 FROM TAB A,TAB B
 WHERE A.PRFX     = B.PRFX
 AND   A.ACCT      = B.ACCT               
 AND   A.SFX       = B.SFX               
 AND   A.TYP      = '08'                                                   
 AND   (PRFX||                                 
       DIGITS(ACCT)||     
       SFX) IN (                           
 SELECT DISTINCT(PRFX||                   
DIGITS(ACCT)||SFX)                                       
FROM TAB C);   


Error message which i have received :
Code:
SQLCODE = 12, WARNING:  THE UNQUALIFIED COLUMN NAME SFX WAS   
INTERPRETED AS A CORRELATED REFERENCE                                   
SQLSTATE   = 01545 SQLSTATE RETURN CODE                                 
SQLERRP    = DSNXORSO SQL PROCEDURE DETECTING ERROR                     
SQLERRD    = 0 0  2  1177631809  0  0 SQL DIAGNOSTIC INFORMATION       
SQLERRD    = X'00000000'  X'00000000'  X'00000002'  X'46313C41'         
X'00000000'  X'00000000' SQL DIAGNOSTIC INFORMATION 
Back to top
View user's profile Send private message
rohanthengal

Active User


Joined: 19 Mar 2009
Posts: 206
Location: Globe, India

PostPosted: Thu Nov 05, 2015 11:26 am
Reply with quote

I know there are mulitple ways to write above SQL but just curious to know about SQLCODE = 12 and why i am getting this WARNING...
Back to top
View user's profile Send private message
rohanthengal

Active User


Joined: 19 Mar 2009
Posts: 206
Location: Globe, India

PostPosted: Thu Nov 05, 2015 11:57 am
Reply with quote

I got the answer... i have mistyped the column name for which it was giving warning. Sorry, it was bad.
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Thu Nov 05, 2015 12:12 pm
Reply with quote

Glad to see you were ale to solve it yourself
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Try to understand IMS control block IMS DB/DC 0
No new posts SQLCODE = -122 while using the scalar... DB2 4
No new posts SQLCODE = -16002 when using XMLEXISTS DB2 1
No new posts Is SQLCODE -811 possible while fetchi... DB2 1
No new posts SQLCODE=-204 SQLSTATE=42704 DB2 4
Search our Forums:

Back to Top