Re: SQLCA.SQLCODE = NOTFOUND, STATUS = 0 ?
Posted in 1995
On Jul 7, 11:03pm, Bashir Akram wrote:
> Subject: SQLCA.SQLCODE = NOTFOUND, STATUS = 0 ?
> One of our programs is doing a fetch (the select below),
> sqlca.sqlcode = NOTFOUND but STATUS = 0, so rather
> than checking on STATUS we have to check on sqlca.sqlcode.
> This is very strange? Anybody ever seen this before?
> It seems that this problem(?) applies to a few more selects in
> our product, looks like its safer to use sqlca.sqlcode?
>
> Informix say this is a known bug on early versions, how early
> is 4.12 on an IBM in the UK?
>-- End of excerpt from Bashir Akram
4.12 is not exactly early but there is another possible reason that you are
seeing this problem. This is basic to 4GL so if this wasn't raised by your
support contact complain to his manager.
sqlca.sqlcode records the status from the last SQL statement executed.
status records the status from the last statement executed.
The result is that if you have the following
select ....let a = b
at this point
status will = 0
sqlca.sqlcode will = notfound
For this reason if you want to trap SQL errors you should always use
sqlca.sqlcode not status as it is too easy for programmers to slip in a line by
mistake.
Of course they may have re-introduced the bug but if this is only happening in
some places I would check your code first.
Cheers - Jim
--
-----------------------------------------------------------------------------
Jim Gordon DHL Airways Inc. jgordon@us.dhl.com
-----------------------------------------------------------------------------
My opinions are my own. They may vary with time but they remain mine!