Re: rgetmsg
Posted in 1998
On Wed, 14 Oct 1998, David Williams wrote:
> In article <36250494.96E3A292@moody.edu>, Henry A.L. Wollman
> <hwollman@moody.edu> writes
> >How come rgetmsg returns the wrong description for an error code 100?
It doesn't. C-ISAM error 100 (positive 100) indicates that the C-ISAM
insert operation failed because of a duplicate value in a unique index,
or words to that effect.
> >It should be "not found" but instead returns something about a duplicate
> >value on insert or update of a unique key.
Actually, SQLNOTFOUND, aka 100, isn't an error so you should not really be
using rgetmsg() or rgetlmsg() to process it.
> >Are there other error codes for which rgetmsg returns the wrong
> >description?
Yes.
Using ~ to mean approximately. Any errors in the range -99..~-40 and
~40..99 are liable to be misleading if you are using an System V machine.
The lower error numbers (~-39..~+39) are the same on both SysV and BSD
machines (because both derived from Version 7 Unix error messages), but the
larger numbers vary between the two platforms. However, the error message
files contain the BSD explanations, not the SysV explanations. So, for
example, ENOLCK error on SVR4 is 46, but the error message from the message
files is 'Protocol family not supported'. This can affect people with SE;
they have run out of locks but get told that there is a networking problem.
You can also get system error messages larger than 100 which can cause
confusion with the ISAM error messages. From -200 downwards or +200 upwards,
you are pretty safe. The rest of the range can be confusing, but usually isn't.
If the error you get doesn't make sense, try looking in /usr/include/sys/errno.h
for the error message:
$ grep 46 /usr/include/sys/errno.h
#define ENOLCK 46 /* No record locks available. */
#define ECONNREFUSED 146 /* Connection refused */
$ chkmsg 46 14646: Protocol family not supported
146: ISAM error: the other copy of this disk is currently disabled or non-existent$ chkmsg -46 -146-46: Protocol family not supported
-146: ISAM error: the other copy of this disk is currently disabled or non-existent
$
I think this error 146 is related to mirrored disks. I'll post my chkmsg
program if desired, but it is neither beautiful nor very tidy in the way it
handles arguments. It's basically a simple interface onto rgetlmsg().
I was testing with 7.24.UC1 error messages.
> >It seems that even the manual as far back as several years
> >ago has the wrong message for a 100. Aren't these things ever fixed? Is
> >rgetmsg not a reliable function? Must I write my own?
> >
> Only 100 appears to be a problem..
Yours,
Jonathan Leffler (jleffler@informix.com) #include <witticism.h>
Guardian of DBD::Informix v0.60 -- http://www.perl.com/CPAN
Informix IDN for D4GL & Linux -- http://www.informix.com/idn