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

SQLCODE groups

P: n/a
Hi!

I was searching through DB2 InfoCenter, but didn't find an answer to my
question:
When I get an SQLCODE from an SQL command (ADMIN_CMD for example) when I
want to know what this code means; is it a warning, error, ....

Best regards,
Kovi

--
-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
| In A World Without Fences Who Needs Gates? |
| Experience Linux. |
-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
Jul 11 '07 #1
Share this Question
Share on Google+
7 Replies


P: n/a
Gregor Kovač wrote:
Hi!

I was searching through DB2 InfoCenter, but didn't find an answer to my
question:
When I get an SQLCODE from an SQL command (ADMIN_CMD for example) when I
want to know what this code means; is it a warning, error, ....
With SQLCODEs, you simply remove the sign and prepend "SQL" in front. This
gives you the message id corresponding to this SQLCODE. For example, if
you have SQLCODE = -104, the corresponding message is SQL104 (or SQL0104 if
you want to pad with leading '0's.)

p.s: It may be that there are exceptions to this rule; but so far I haven't
encountered any.
p.p.s: There is work on the way to get such information on a programmatical
way from DB2 itself.

--
Knut Stolze
DB2 z/OS Utilities Development
IBM Germany
Jul 11 '07 #2

P: n/a
Further: negative numbers are errors, positive numbers are warnings.

Cheers
Serge

--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Jul 11 '07 #3

P: n/a
Hi!

So, what Knut ans Serge are saying...
For example, with IMPORT I get in message file:
SQL3149N "1" rows were processed from the input file. "0" rows were
successfully inserted into the table. "1" rows were rejected.

And since this is code 3149 0, should I consider this is a warning?

Best regards,
Kovi

Gregor Kovač wrote:
Hi!

I was searching through DB2 InfoCenter, but didn't find an answer to my
question:
When I get an SQLCODE from an SQL command (ADMIN_CMD for example) when I
want to know what this code means; is it a warning, error, ....

Best regards,
Kovi
--
-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
| In A World Without Fences Who Needs Gates? |
| Experience Linux. |
-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
Jul 11 '07 #4

P: n/a
Gregor Kovač wrote:
Hi!

So, what Knut ans Serge are saying...
For example, with IMPORT I get in message file:
SQL3149N "1" rows were processed from the input file. "0" rows were
successfully inserted into the table. "1" rows were rejected.

And since this is code 3149 0, should I consider this is a warning?
The message id is SQL3149. To get the SQLCODE for this message (if it has
one), you can simply run:

$ db2 "? sql3149"

This particular message is _not_ associated with a SQLCODE.

However, there is another piece of information encoded in the message id.
The last character of the message id classifies the error like this:

'C' - critical error
'N' - normal error
'W' - warning
'I' - informational message

--
Knut Stolze
DB2 z/OS Utilities Development
IBM Germany
Jul 11 '07 #5

P: n/a
Hi!

Great, this is exactly what I wanted to know. :))
Is there a page in DB2 InfoCenter where this is stated?

Best regards,
Kovi

Knut Stolze wrote:
Gregor Kovač wrote:
>Hi!

So, what Knut ans Serge are saying...
For example, with IMPORT I get in message file:
SQL3149N "1" rows were processed from the input file. "0" rows were
successfully inserted into the table. "1" rows were rejected.

And since this is code 3149 0, should I consider this is a warning?

The message id is SQL3149. To get the SQLCODE for this message (if it has
one), you can simply run:

$ db2 "? sql3149"

This particular message is _not_ associated with a SQLCODE.

However, there is another piece of information encoded in the message id.
The last character of the message id classifies the error like this:

'C' - critical error
'N' - normal error
'W' - warning
'I' - informational message
--
-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
| In A World Without Fences Who Needs Gates? |
| Experience Linux. |
-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
Jul 11 '07 #6

P: n/a
On Jul 11, 2:58 pm, Gregor Kova <gregor.ko...@mikropis.siwrote:
Hi!

Great, this is exactly what I wanted to know. :))
Is there a page in DB2 InfoCenter where this is stated?

Best regards,
Kovi

Knut Stolze wrote:
Gregor Kova wrote:
Hi!
So, what Knut ans Serge are saying...
For example, with IMPORT I get in message file:
SQL3149N "1" rows were processed from the input file. "0" rows were
successfully inserted into the table. "1" rows were rejected.
And since this is code 3149 0, should I consider this is a warning?
The message id is SQL3149. To get the SQLCODE for this message (if it has
one), you can simply run:
$ db2 "? sql3149"
This particular message is _not_ associated with a SQLCODE.
However, there is another piece of information encoded in the message id.
The last character of the message id classifies the error like this:
'C' - critical error
'N' - normal error
'W' - warning
'I' - informational message
http://publib.boulder.ibm.com/infoce...c/r0002159.htm

http://publib.boulder.ibm.com/infoce...c/c0mintro.htm

HTH.

--
Jeroen
Jul 11 '07 #7

P: n/a
http://publib.boulder.ibm.com/infoce...c/c0mintro.htm

--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Jul 11 '07 #8

This discussion thread is closed

Replies have been disabled for this discussion.