View previous topic :: View next topic
|
Author |
Message |
gmreddy
New User
Joined: 05 May 2005 Posts: 2
|
|
|
|
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 |
|
|
Deepa.m
New User
Joined: 28 Apr 2005 Posts: 99
|
|
Back to top |
|
|
gmreddy
New User
Joined: 05 May 2005 Posts: 2
|
|
|
|
Hi deepa,
can you give the clear explanation about sqlcode& sql state.
|
|
Back to top |
|
|
brain_s390
New User
Joined: 06 May 2005 Posts: 58 Location: Mumbai
|
|
|
|
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 |
|
|
|