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

SQLSTATE / SQLCODE

P: n/a
Dear all,

Could you explain why some SQL messages do not possess a SQLSTATE ?

Why not transmitting the SQLSTATE of the original <sqlcode>, for example if
you get a -911 on a RUNSTATS ?

SQL2310N The utility could not generate statistics. Error
"<sqlcode>" was returned.

Thanks,

JM
Nov 12 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
"Jean-Marc Blaise" <no****@nowhere.com> wrote in message
news:ca**********@news-reader1.wanadoo.fr...
Dear all,

Could you explain why some SQL messages do not possess a SQLSTATE ?

Why not transmitting the SQLSTATE of the original <sqlcode>, for example if you get a -911 on a RUNSTATS ?

SQL2310N The utility could not generate statistics. Error
"<sqlcode>" was returned.

Thanks,

JM

You can use the -e option on the CLP to request the SQLCODE or SQLSTATE. See
the Command Reference manual for details.
Nov 12 '05 #2

P: n/a
Jean-Marc,

Can you calirify? Do you want
SQL2310N The utility could not generate statistics. Error
"<sqlcode>" _with_SQLSTATE_"<sqlstate>"_ was returned.

or
SQL2310N The utility could not generate statistics. Error
"<sqlcode>" was returned.
_SQLSTATE=xxxxx_

Cheers
Serge
--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab
Nov 12 '05 #3

P: n/a
Hi Serge,

It would be more like:
SQL2310N The utility could not generate statistics. Error
"<sqlcode>" was returned.
_SQLSTATE=xxxxx_

The RUNSTATS error seems to be sometimes SQL2310N or another code (without
SQLSTATE), other times you could get a SQLCODE and SQLSTATE (at least in V7
.... I was trapping SQLSTATEs in shell scripts and realized I only got
SQLCODEs, so missed some info).

But why such a difference as below - can you give a rule of SQLCODEs with or
without SQLSTATEs ?

* RUNSTATS ON TABLE DB2ADMIN.TITI gives:
SQL2306N The table or index "DB2ADMIN.TITI" does not exist. (no SQLSTATE)

* SELECT * FROM DB2ADMIN.TITI gives:
SQL0204N "DB2ADMIN.TITI" is an undefined name. SQLSTATE=42704

Cheers,

Jean-Marc

"Serge Rielau" <sr*****@ca.eye-be-em.com> a écrit dans le message de
news:ca**********@hanover.torolab.ibm.com...
Jean-Marc,

Can you calirify? Do you want
SQL2310N The utility could not generate statistics. Error
"<sqlcode>" _with_SQLSTATE_"<sqlstate>"_ was returned.

or
SQL2310N The utility could not generate statistics. Error
"<sqlcode>" was returned.
_SQLSTATE=xxxxx_

Cheers
Serge
--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab

Nov 12 '05 #4

P: n/a
Duly noted. Don't expect a fix in Stinger though.

Cheers
Serge
--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab
Nov 12 '05 #5

P: n/a
The general rule is that SQL statements (everything in the SQL reference)
will return errors with SQLSTATEs whereas commands and utilities
(everything not in the SQL Reference) will not have SQLSTATEs.
--
__________________________________________________ ___________________
Doug Doole
DB2 Universal Database Development
IBM Toronto Lab

Visit the DB2 UDB and DB2 Connect Online Support site at:
http://www.ibm.com/software/data/db2...s2unix/support
Nov 12 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.