Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
sql code & sql state

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
gmreddy

New User


Joined: 05 May 2005
Posts: 2

PostPosted: Fri May 13, 2005 11:03 am    Post subject: sql code & sql state
Reply with quote

Hi,
Please any one give me the reply..

In SQLCA there are SQL CODE & SQL STATE . What exactly they specify.
and difference between the two?

bye
Back to top
View user's profile Send private message

Deepa.m
Warnings : 1

New User


Joined: 28 Apr 2005
Posts: 99

PostPosted: Fri May 13, 2005 2:26 pm    Post subject: Re: sql code & sql state
Reply with quote

An SQLCODE is a return code. The return code is sent by the database manager after completion of each SQL statement

An SQLSTATE value is a return code that indicates the outcome of the most recently executed SQL statement

confused!! both sounds the same right!! here comes the difference.

http://publib.boulder.ibm.com/infocenter/iseries/v5r3/ic2924/index.htm?info/rzala/rzalaco.htm
Back to top
View user's profile Send private message
gmreddy

New User


Joined: 05 May 2005
Posts: 2

PostPosted: Sat May 14, 2005 10:27 am    Post subject: Re: sql code & sql state
Reply with quote

Hi deepa,
can you give the clear explanation about sqlcode& sql state.

Deepa.m wrote:
An SQLCODE is a return code. The return code is sent by the database manager after completion of each SQL statement

An SQLSTATE value is a return code that indicates the outcome of the most recently executed SQL statement

confused!! both sounds the same right!! here comes the difference.

http://publib.boulder.ibm.com/infocenter/iseries/v5r3/ic2924/index.htm?info/rzala/rzalaco.htm
Back to top
View user's profile Send private message
brain_s390

New User


Joined: 06 May 2005
Posts: 58
Location: Mumbai

PostPosted: Sat May 14, 2005 3:30 pm    Post subject: Re: sql code & sql state
Reply with quote

SQLCA is the SQL Communication area.You can consider it as a collection or grp of variables that are updated after each SQL statement executes. An application program that contains executable SQL statements must provide exactly one SQLCA.

Whenever an SQL statement executes, the SQLCODE and SQLSTATE fields of the SQLCA receive a return code. Although both fields serve basically the same purpose (indicating whether the statement executed successfully) there are some differences between the two fields.
SQLCODE: DB2 returns the following codes in SQLCODE:

If SQLCODE = 0, execution was successful.
If SQLCODE > 0, execution was successful with a warning.
If SQLCODE < 0, execution was not successful.

SQLCODE 100 indicates no data was found.

The meaning of SQLCODEs other than 0 and 100 varies with the particular product implementing SQL.

SQLSTATE: SQLSTATE allows an application program to check for errors in the same way for different IBM database management systems.

An advantage to using the SQLCODE field is that it can provide more specific information than the SQLSTATE. Many of the SQLCODEs have associated tokens in the SQLCA that indicate, for example, which object incurred an SQL error.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Speed-up/reduce CPU use of code prino PL/I & Assembler 0 Tue Sep 26, 2017 12:05 am
This topic is locked: you cannot edit posts or make replies. how to code for GDG in Rexx cvnlynn CLIST & REXX 13 Wed Aug 09, 2017 9:13 pm
This topic is locked: you cannot edit posts or make replies. rexx code to create a ps file Bharath Vikraman CLIST & REXX 4 Mon Aug 07, 2017 10:30 am
No new posts I want to retire TRX and use only Rex... Abhinav Sharma CLIST & REXX 6 Sat Jul 29, 2017 2:53 am
No new posts UNIT=AFF for Easytrieve code gandikk JCL & VSAM 7 Wed Jul 12, 2017 11:42 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us