Jan M. Nelken wrote:
Jean-David Beyer wrote:
I know it is. I am not having trouble decoding the XXXnnnnA messages,
but the sub-message of certain XXXnnnnA messages that are
characterized by SQL CODES.
...
I KNOW ALL THAT. Where do I look for SQL CODES (i.e., the "positive
or negative numbers"?
...
User Response: Look at the SQLCODE (message number) in the message
for more information. Make changes and resubmit the command.
We both agree that the correct SQLCODE I got could not have been
-1304, but I need a way to look that up, and it is not SQL1304N or
anything like it. I need a separate table for the SQL CODES. And I do
not think it is an SQLSTATE message (though it might be). Too bad it
scrolled off the screen.
OK let me try one more time:
IF you have a SQL Code of -nnnnn or +nnnnn) where n represent numeric
digit between 0 and 9 inclusive,
THEN there are two cases:
Case 1: it is a valid SQL code; Look up message SQLnnnnn (without - or
+ in front of nnnnnn part - either in the Messages manual or by issuing
db2 ? sqlnnnnn
Case 2: it is invalid or internal SQL code; You would
not find corresponding SQLnnnnn message in the Messages manual and db2
? sqlnnnnn would return SQL CODE -10007
For the purpose of the example, let us say I got error SQL2215N or
whatever it was and it included an SQL CODE -10007. I do not need it to
tell me -10007 again: I need the explanation of what the -10007 means so I
can fix the problem and retry it as the explanation for SQL2215N requires.
Here is an exercise for you: using above algorithm look up SQL Code
-10007.
Example does not seem to work well.
trillian:jdbeyer[~]$ echo $DB2INSTANCE
db2inst1
(This is a valid instance.)
trillian:jdbeyer[~]$ echo $LANG
POSIX
trillian:jdbeyer[~]$ echo $DB2CODEPAGE
[i.e., blank]
db2 => ? sql10007;
SQL10007N Message "<msgno>" could not be retrieved. Reason
code: "<code>".
Explanation:
The requested message <msgno> could not be retrieved from the
message file. Reason code <code> is one of the following:
1. The environment variable "DB2INSTANCE" is either not set, or
is set to an invalid instance. Correct it and try again.
2. The message file was found, but the file could not be opened
because of permissions. Check the file permissions of the
files under the message directory.
3. The message file could not be found. Either the file does
not exist, or the directory the message file should be in
does not exist. Check that a either a 'prime' directory (the
default) or a directory with the same name as the 'LANG'
environment variable exists under the message directory.
If I understand this correctly, by "message directory" they mean
/opt/IBM/db2/V8.1/msg/en_US.iso88591. Is this correct?
Now it is really impractical to change $LANG for this since it would trash
other programs that rely on its being POSIX.
4. The requested message does not exist in the message file.
Either the message file is outdated, or it is the wrong
one.
5. Either DB2CODEPAGE is set to a code page which the database
does not support, or the client's locale is not supported by
the database.
6. An unexpected system error occurred. Try execution again.
If problem persists, contact your IBM representative.
7. Not enough memory. An attempt to get private memory failed.
Try again.
I have 4 Gigabytes RAM, mostly available.
User Response:
Reissue the command after verifying the following:
o ensure that the DB2INSTANCE environment variable is set to
the correct literal string for the username attempting this
command
o ensure that correct home directory is specified for the
username attempting this command (i.e. in the /etc/passwd
file)
o ensure that the LANG environment variable is set to the
correct value for the installed language, or is set to 'C'
(defaults to whatever is in the 'prime' directory), on the
username attempting this command
If all of the above are correct and the error still occurs,
reinstall DB2.
--
.~. Jean-David Beyer Registered Linux User 85642.
/V\ Registered Machine 241939.
/( )\ Shrewsbury, New Jersey
http://counter.li.org
^^-^^ 22:15:00 up 12 days, 11:11, 4 users, load average: 4.36, 4.31, 4.19