Unix Technical Forum

Matching SQLCODES to SQL Statements

This is a discussion on Matching SQLCODES to SQL Statements within the DB2 forums, part of the Database Server Software category; --> Is there a guide, pamphlet, book, website, PDF or scroll somewhere which states the SQLCODES which are valid for ...


Go Back   Unix Technical Forum > Database Server Software > DB2

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-27-2008, 02:08 PM
BugleBoy
 
Posts: n/a
Default Matching SQLCODES to SQL Statements

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!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-27-2008, 02:08 PM
louisem
 
Posts: n/a
Default Re: Matching SQLCODES to SQL Statements

On Nov 29, 2:55 pm, BugleBoy <dfaill...@gmail.com> wrote:
> 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!


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/infoce...n/r0000970.htm

Is this what you are looking for?

Louise McNicoll
DB2 Information Development

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-27-2008, 02:09 PM
BugleBoy
 
Posts: n/a
Default Re: Matching SQLCODES to SQL Statements

> 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/infoce...ic/com.ibm.db2...
>
> Is this what you are looking for?
>
> 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!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-27-2008, 02:09 PM
Serge Rielau
 
Posts: n/a
Default Re: Matching SQLCODES to SQL Statements

Bugleboy,

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

Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-27-2008, 02:09 PM
louisem
 
Posts: n/a
Default Re: Matching SQLCODES to SQL Statements

On Dec 3, 5:33 pm, BugleBoy <dfaill...@gmail.com> wrote:

>
> 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


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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 02-27-2008, 02:09 PM
Dan van Ginhoven
 
Posts: n/a
Default Re: Matching SQLCODES to SQL Statements


"BugleBoy" <dfaillace@gmail.com> wrote in message
news:1aaf380d-fb3c-4ec6-9322-8936b1ffbba9@w34g2000hsg.googlegroups.com...
> 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!


You can make an extract from "Message Reference Vol.2" db2m2e90.pdf and
create a cross reference
for sqlstates vs sqlcodes.
/dg


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 08:56 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com