Subject RE: [ib-support] Strange query results, based on where clause
Author Ann W. Harrison
At 10:08 AM 3/4/2002 -0500, Leyne, Sean wrote:

>...The solution is to make the unindexed result
>consistent. Meaning:
> - '0617' <> 617 and
> - '617' = 617
>but
> - '0617' <> 0617 and
> - '617' = 0617.
>
>The fact that the engine will convert integer values to strings is a
>convenience, it doesn't absolve the developers from using a little
>common sense when performing selects.

The problem is actually that it converts strings to numbers
rather than vice-versa. Very hard to preserve leading zeros
in that conversion. The conversion fails, of course, if it
finds any character other than a digit or a decimal point.
It could fail, I suppose, if it were converting from a string
to a number and the number had leading zeros.

On the third hand, when reading from an external file, it
is very desirable to be able to convert from 0098 to 98 -
assuming that the value was ascii in a fixed record-length
file and the database will store it as some variant of
numeric.



Regards,

Ann
www.ibphoenix.com
We have answers.