Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / DB2 Topics / December 2007

Tip: Looking for answers? Try searching our database.

Matching SQLCODES to SQL Statements

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
BugleBoy - 29 Nov 2007 19:55 GMT
Is there a guide, pamphlet, book, website, PDF or scroll somewhere
which states the SQLCODES which are valid for each SQL statement
(i.e., INSERT, CALL, FETCH, DECLARE CURSOR) in IBM DB2 (v7 or 8)?

I sometimes fall into the situation where someone has coded (or not) a
questionable EVALUATE SQLCODE statement after an EXEC SQL statement.

Thanks to all of you, in advance, for your support!
louisem - 30 Nov 2007 10:43 GMT
> Is there a guide, pamphlet, book, website, PDF or scroll somewhere
> which states the SQLCODES which are valid for each SQL statement
[quoted text clipped - 4 lines]
>
> Thanks to all of you, in advance, for your support!

Hi,

The SQLCODE seems to be included with each SQL Statement topic in the
Info Center.  For example, the V8 Insert statement has them in it:

http://publib.boulder.ibm.com/infocenter/db2luw/v8//topic/com.ibm.db2.udb.doc/ad
min/r0000970.htm


Is this what you are looking for?

Louise McNicoll
DB2 Information Development
BugleBoy - 03 Dec 2007 22:33 GMT
> Hi,
>
[quoted text clipped - 7 lines]
> Louise McNicoll
> DB2 Information Development

Well ... it has some SQLSTATE codes for some specific conditions
like ..."If the result table is empty, SQLCODE is set to +100 and
SQLSTATE is set to '02000'."

But, is there a table or display which lists the probable SQLCODEs for
a specific statment, with out reading the whole explanation of the
usage of the statement.

Thanks for your help so far Louise!
Serge Rielau - 04 Dec 2007 12:29 GMT
Bugleboy,

The SQL Reference manual typically lists SQLSTATEs.
Can you use these instead? SQLCODE are less portable across vendors.

Cheers
Serge
Signature

Serge Rielau
DB2 Solutions Development
IBM Toronto Lab

louisem - 05 Dec 2007 11:39 GMT
> Well ... it has some SQLSTATE codes for some specific conditions
> like ..."If the result table is empty, SQLCODE is set to +100 and
[quoted text clipped - 5 lines]
>
> Thanks for your help so far Louise

Hi, I checked with our other writers and we don't have such a table or
list. The best suggestion that I got for you was that you can perhaps
use the search feature to return all the statements with a specific
code or state.

Regards,

Louise McNicoll
DB2 Information Development
Dan van Ginhoven - 05 Dec 2007 16:50 GMT
> Is there a guide, pamphlet, book, website, PDF or scroll somewhere
> which states the SQLCODES which are valid for each SQL statement
[quoted text clipped - 4 lines]
>
> Thanks to all of you, in advance, for your support!

You can  make an extract from "Message Reference Vol.2" db2m2e90.pdf and
create a cross reference
for sqlstates vs  sqlcodes.
/dg
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.