Página 1 de 1

Sqlite : Funny behavior while saving numeric value in char field.

Publicado: Vie Sep 19, 2014 1:45 pm
por Milan Mehta
I have been facing this problem randomly. When I try to store pure numeric value in a character field, Xailer stores some funny value. Like when I tried to store value 121 in Varchar(7) field, it stores value like -21456. This is consistently happening in a field. However it is working fine in other fields.
What am I doing wrong ?
How can I ascertain that Xailer do not type change a value.
TIA
Milan.

Sqlite : Funny behavior while saving numeric value in char field.

Publicado: Vie Sep 26, 2014 11:05 am
por jfgimenez
Milan,
> I have been facing this problem randomly. When I try to
> store pure numeric value in a character field, Xailer stores
> some funny value. Like when I tried to store value 121 in
> Varchar(7) field, it stores value like -21456. This is
> consistently happening in a field. However it is working
> fine in other fields.
>
> What am I doing wrong ?
> How can I ascertain that Xailer do not type change a value.
SQLite allows *any* type of data in any field. The declared column type
is just that... a declared type, but doesn't enforce to store data of
that type.
However, there are several substring in the declared column type which
are used by Xailer to determine how to convert or handle that value.
I.e., if a column has a declared type that contains "DATE" ("DATE",
"DATETIME", "DATEVALUE", ...) , Xailer treats it as a date.
Regards,
Jose F. Gimenez
http://www.xailer.com
http://www.xailer.info