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

Error code -206 while fetching record from table


IBM Mainframe Forums -> ABENDS & Debugging
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sm_2009

New User


Joined: 10 May 2009
Posts: 72
Location: bangalore

PostPosted: Mon May 11, 2009 10:41 am
Reply with quote

Hi All,

I am getting sqlcode -206 in the following fetch query:

EXEC SQL
SELECT EMPLOYER_NAME, PRODUCT_ID
INTO :DCLPLCY-EMPLOYER-NAME,:DCLPLCY-PRODUCT-ID
FROM POLICY
WHERE :DCLPLCY-POLICY-NBR = WS-POLICY-NBR
END-EXEC

i checked the reason as - name IS NOT VALID IN THE CONTEXT WHERE IT IS USED

please help me in debugging this.
Back to top
View user's profile Send private message
Srihari Gonugunta

Active User


Joined: 14 Sep 2007
Posts: 295
Location: Singapore

PostPosted: Mon May 11, 2009 11:00 am
Reply with quote

Hi,
Please verify the column names in the query.

Code:
WHERE :DCLPLCY-POLICY-NBR = WS-POLICY-NBR
Back to top
View user's profile Send private message
sm_2009

New User


Joined: 10 May 2009
Posts: 72
Location: bangalore

PostPosted: Mon May 11, 2009 11:02 am
Reply with quote

In DCLGEN

DCLPLCY-POLICY-NBR is PIC S9(9) USAGE COMP.

and ws-policy-nbr is PIC 9(9).

is it creating any problem?
Back to top
View user's profile Send private message
anandinmainframe

Active User


Joined: 31 May 2007
Posts: 171
Location: India

PostPosted: Mon May 11, 2009 11:29 am
Reply with quote

Sm,
The reason for -206 is
Quote:

column-name IS NOT A COLUMN OF AN INSERTED TABLE, UPDATED TABLE, OR ANY TABLE IDENTIFIED IN A FROM CLAUSE

so check whether the column name is correct or not.[/quote]
Back to top
View user's profile Send private message
sm_2009

New User


Joined: 10 May 2009
Posts: 72
Location: bangalore

PostPosted: Mon May 11, 2009 11:43 am
Reply with quote

okie, i removed the working storage variable from WHERE clause.

the error is debugged.

Thanks all.
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 -> ABENDS & Debugging

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Error to read log with rexx CLIST & REXX 11
No new posts Load new table with Old unload - DB2 DB2 6
No new posts Error when install DB2 DB2 2
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top