IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search Log in to check your private messages Log in
 

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: 195
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: 195
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: 195
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

Moderator


Joined: 07 Sep 2006
Posts: 1566
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 All times are GMT + 6 Hours
Forum Index -> DB2
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Forum Replies
No new posts Is SQLCODE -811 possible while fetchi... DB2 1
No new posts SQLCODE=-204 SQLSTATE=42704 DB2 4
No new posts Getting sqlcode 805 while executing R... DB2 10
No new posts SQLCODE -950 in PREPARE statement ... DB2 2
No new posts How to resolve sqlcode of CALL ATTACH... DB2 3

Back to Top