In order for this site to work correctly we need to store a small file (called a cookie) on your computer. Most every site in the world does this, however since the 25th of May 2011, by law we have to get your permission first. Please abandon the forum if you disagree.

Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.

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

Xailer English public forum
Responder
Milan Mehta
Mensajes: 134
Registrado: Dom Dic 27, 2009 9:54 am

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

Mensaje 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.
Avatar de Usuario
jfgimenez
Site Admin
Mensajes: 5706
Registrado: Lun Abr 06, 2015 8:48 pm
Contactar:

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

Mensaje 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
José F. Giménez
[Equipo de Xailer / Xailer team]
http://www.xailer.com
http://www.xailer.info
Responder