On Thu, 11 Feb 1999, Mark Collins wrote:
> > Jonathan Leffler wrote (agreeing with Art Kagel):
> > SQLCODE and sqlca.sqlcode error numbers are always negative.
>
> Are they ALWAYS negative? What about +100/-100?
>
> 100 No matching records found.
>
> -100 ISAM error: duplicate value for a record with uniquekey.
>
> I'm pretty sure bothe show up in sqlca.sqlcode. (I hope I'm right, as
> it's not often one gets to correct either Art or John, let alone both at
> the same time.)
You certainly get credit for pointing out that I didn't mention +100, and it
can show up in SQLCODE and sqlca.sqlcode.
Whether +100 (NOTFOUND, SQLNOTFOUND) is an error is a debatable point. It
is an indication that no records were found; it isn't clear (to me) that is
an error. For example, if you are using a cursor to fetch rows of data
from a database, you get the return status of +100 when there are no more
rows to fetch. That isn't an error, any more than reaching EOF on a file
is an error; it simply indicates that some different processing will be
required from this point on. So, in my book, +100 is not an error, and my
comment is correct. If you wish to write your book with +100 being an
error condition, far be it from me to stop you, but I don't think it is the
best way to view the 'not found' code.
If you look at the ESQL/C DESCRIBE statement carefully, you find it returns
a non-zero but positive code when it succeeds and the described statement
is not a simple SELECT statement (eg SELECT INTO TEMP or any other SQL
statement). These are not errors, though, so I ignored both this and
SQLNOTFOUND for the sake of brevity in my previous answer.
Yours,
Jonathan Leffler (jleffler@informix.com) #include <wish/I/was/skiing.h>
Guardian of DBD::Informix v0.60 (v0.61_02) -- http://www.perl.com/CPAN
Informix IDN for D4GL & Linux -- http://www.informix.com/idn