By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,558 Members | 1,068 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,558 IT Pros & Developers. It's quick & easy.

Matching SQLCODES to SQL Statements

P: n/a
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!
Nov 29 '07 #1
Share this Question
Share on Google+
5 Replies


P: n/a
On Nov 29, 2:55 pm, BugleBoy <dfaill...@gmail.comwrote:
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

Nov 30 '07 #2

P: n/a
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!
Dec 3 '07 #3

P: n/a
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
Dec 4 '07 #4

P: n/a
On Dec 3, 5:33 pm, BugleBoy <dfaill...@gmail.comwrote:
>
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
Dec 5 '07 #5

P: n/a

"BugleBoy" <df*******@gmail.comwrote in message
news:1a**********************************@w34g2000 hsg.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
Dec 5 '07 #6

This discussion thread is closed

Replies have been disabled for this discussion.