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

SQLSTATE Vs SQLCODE


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

Active User


Joined: 31 Aug 2006
Posts: 218
Location: India

PostPosted: Mon Aug 23, 2010 4:29 pm
Reply with quote

Hi All,
Till now i used SQLCODE in Cobol-Db2 programs for verifying the successful execution of the query or end of records and any abend etc.

But when i analyzing a program i came across SQLSTATE instead of SQLCODE. Does it has an advantage over SQLCODE?

Which one is preferred to use and why?

Seniors please provide some information.

Thanks
Sri.
Back to top
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1020
Location: India

PostPosted: Mon Aug 23, 2010 5:33 pm
Reply with quote

Hi Sri,

Quote:
Practically speaking, you should use SQLSTATE values when you are concerned about portability since SQLSTATE values are common across many database managers.


Check this link

Thanks,
Sushanth
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 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
No new posts Getting sqlcode 805 while executing R... DB2 10
Search our Forums:

Back to Top