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

How to find column causing error


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

New User


Joined: 30 Aug 2005
Posts: 23

PostPosted: Mon Jan 26, 2009 11:25 pm
Reply with quote

Hi All,
Usually when we get sql error in a cobol db2 program it is difficult to find out due which column the sql error was generated.For example when we get SLCODE=-305 when null value is encountered it is difficult track which column of the table causing the error.Is there is any way which we can find out the column causing the error .One way is we have to use display statement.Can we track the error using fields declared under SQLCA group data item.
Back to top
View user's profile Send private message
murugan_mf

Active User


Joined: 31 Jan 2008
Posts: 148
Location: Chennai, India

PostPosted: Thu Jan 29, 2009 11:48 pm
Reply with quote

If column is a nullable then you must use indicator variables.
By displaying the indicator variable value you can find out whether the colomn is null or not.
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Fri Jan 30, 2009 12:16 am
Reply with quote

Look at "DSNTIAR" in the DB2 Application Programming Guide.
Back to top
View user's profile Send private message
prashanth1

New User


Joined: 27 Sep 2006
Posts: 47
Location: Hyderabad

PostPosted: Fri Jan 30, 2009 12:27 pm
Reply with quote

Harish,

Try with SQLERRM . Probably it may help you to find which column is giving the problem .
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 Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Error to read log with rexx CLIST & REXX 11
No new posts Error when install DB2 DB2 2
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts CLIST - Virtual storage allocation error CLIST & REXX 5
Search our Forums:

Back to Top