Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Error written to errlog even if "whenever error continue" is used

90 views
Skip to first unread message

Long Nguyen

unread,
Oct 22, 2001, 11:05:07 PM10/22/01
to


Hi everyone,
In checking a numeric value in a char field we usually use the following pattern:
whenever error continue
let numeric_field = input char_field
whenever error stop
if numeric_field is NULL then # when value is not numeric
return false
else
return true
end if
In Informix 4gl version 5x there is no error written to the errlog file when the input char_field contains an alphabetic value.
However in version 7x the following errors are written to the errlog: "FORMS statement error number -1213.
Character to numeric conversion error".
Although it does not stop the program but the error message will fill up the file and sometimes confuse us.

Is there any way to stop this error message written into errlog? (some flag setting?)

Regards,
Long Nguyen
A/P


Robert A. Reissaus

unread,
Oct 23, 2001, 8:48:52 AM10/23/01
to
Yes you can, by actually coding this correct.
The errors will allways be written to the log file, as they should.
Programmers are supposed to read the error log and solve the errors.

This particular one may cause havoc in your database and cause your
numerical data to totally unreliable since the receiving value will be
NULL and hence everything derived from that will be NULL. SOLVE IT.

R.A.Reissaus
Risdi, RaReSoft Imaginair
Informix since 1987.
The Netherlands
r.a.re...@risdi.com
========================
"Long Nguyen" <lng...@ruralco.com.au> wrote in message news:<9r2nai$kf0$1...@news.xmission.com>...

Michael Krzepkowski

unread,
Oct 23, 2001, 9:58:34 AM10/23/01
to

"Robert A. Reissaus" wrote:

> Yes you can, by actually coding this correct.

What is incorrect in his coding? The assignment strips alpha characters
and gives you number.

>
> The errors will allways be written to the log file, as they should.
> Programmers are supposed to read the error log and solve the errors.

FORMS errors are unique in they don't give you module nor line number.

>
>
> This particular one may cause havoc in your database and cause your
> numerical data to totally unreliable since the receiving value will be
> NULL and hence everything derived from that will be NULL. SOLVE IT.
>
> R.A.Reissaus
> Risdi, RaReSoft Imaginair
> Informix since 1987.
> The Netherlands
> r.a.re...@risdi.com
> ========================

I haven't tried, but will "whenever any error" make any difference.

HTH

Michael
BTW: Informix since 1984

Robert A. Reissaus

unread,
Oct 24, 2001, 9:59:07 AM10/24/01
to
No Michael, it will give you a number WHEN the character value is
within the limits of the numerical data type you catch it in.
Otherwise it becomes NULL.
And as a result everything you do with that numerical value is
bollocks! His coding is wrong because he doesn't cater for that!

I know forms errors don't give you a line number, but I assume Long
Nguyen has found where it occurs, probably by trial and error.

Whenever any error won't make a difference.

Now, if you can explain why forms errors do not give you a line
number, then i just might believe you have been working with informix
since 1984 (that would be the DOS version)!

R.A.Reissaus
Risdi, RaReSoft Imaginair
Informix since 1987.
The Netherlands
r.a.re...@risdi.com


Michael Krzepkowski <mich...@sqlcanada.com> wrote in message news:<3BD57748...@sqlcanada.com>...

Michael Krzepkowski

unread,
Oct 24, 2001, 11:24:08 AM10/24/01
to
Hi,

I used similar method to extract digits from the field where user can
enter other valid non-numeric characters. Phone number would be a good
example. He was checking for null value, but was assuming this would
only happen if the value was "non-numeric".

And back in 1983/1984 it was Unix and Xenix, and I still have a customer
running Informix 3.30.14 , a pre-SQL version. And no, I never tried
to find out why in this situation they don't provide line number, since
assignment/conversion would be something similar to a function call.
Knowing why the numbers are not there wouldn't make finding
the problem any easier.

Regards,

Michael

0 new messages