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
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>...
"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
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>...
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