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.
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 Bug on date fields
SQLite Bug on date fields
Hello Xailers,
It seems there is a weird bug with the date fields, using the command ATTACH from sqlite to copy a table and its contents, all the date fields were saved as numeric values.
See the example for more detailed info about this error.
What could be causing this?
TIA,
Juliano
It seems there is a weird bug with the date fields, using the command ATTACH from sqlite to copy a table and its contents, all the date fields were saved as numeric values.
See the example for more detailed info about this error.
What could be causing this?
TIA,
Juliano
- Adjuntos
-
- TestSQLite.zip
- (50.16 KiB) Descargado 220 veces
- ignacio
- Site Admin
- Mensajes: 9253
- Registrado: Lun Abr 06, 2015 8:00 pm
- Ubicación: Madrid, Spain
- Contactar:
Re: SQLite Bug on date fields
Hi,
We are working on this problem right now. BTW, in our tests with oDS:lDateAsString to .T. works correctly. I recommend to use lDateAsString to .T., it uses more disk space, but is the standard on SQLite databases. In any case we hope to have a fix for this problem ASAP.
Regards,
We are working on this problem right now. BTW, in our tests with oDS:lDateAsString to .T. works correctly. I recommend to use lDateAsString to .T., it uses more disk space, but is the standard on SQLite databases. In any case we hope to have a fix for this problem ASAP.
Regards,
Re: SQLite Bug on date fields
Many thanks Ignacio!
We are going to take a look on the lDateAsString while we wait for the fix then.
Regards,
Juliano
We are going to take a look on the lDateAsString while we wait for the fix then.
Regards,
Juliano
- ignacio
- Site Admin
- Mensajes: 9253
- Registrado: Lun Abr 06, 2015 8:00 pm
- Ubicación: Madrid, Spain
- Contactar:
Re: SQLite Bug on date fields
Juliano,emeasoft escribió:Many thanks Ignacio!
We are going to take a look on the lDateAsString while we wait for the fix then.
Regards,
Juliano
Please try with the files attached (.obj for Borland and .o for MinGW) . TIA.
Regards,
- Adjuntos
-
- isqlite.rar
- (12.7 KiB) Descargado 227 veces
Re: SQLite Bug on date fields
Hello Ignacio,
I tested with the .o file but the error still persists.
Regards,
Juliano
I tested with the .o file but the error still persists.
Regards,
Juliano
- ignacio
- Site Admin
- Mensajes: 9253
- Registrado: Lun Abr 06, 2015 8:00 pm
- Ubicación: Madrid, Spain
- Contactar:
Re: SQLite Bug on date fields
Hello Juliano,
I attach with this message the two DBs created by me with the modification I sent you. They look fine. Maybe the object module did not get really linked to the executable. Please try a complete recompile.
BTW, in order to force the use of the new module I attach with this message the complete Xailer library for MingGw, that you can download from the following link:
https://dl.dropboxusercontent.com/u/318 ... Xailer.zip
Regard,
I attach with this message the two DBs created by me with the modification I sent you. They look fine. Maybe the object module did not get really linked to the executable. Please try a complete recompile.
BTW, in order to force the use of the new module I attach with this message the complete Xailer library for MingGw, that you can download from the following link:
https://dl.dropboxusercontent.com/u/318 ... Xailer.zip
Regard,
- Adjuntos
-
- sqlite.rar
- (727 Bytes) Descargado 221 veces
Re: SQLite Bug on date fields
Thanks Ignacio! It worked now!
Just one more question, the date fields on the database created by the attach command are returning as char, not date as on the original table.
Is there any fix for this?
TIA,
Juliano
Just one more question, the date fields on the database created by the attach command are returning as char, not date as on the original table.
Is there any fix for this?
TIA,
Juliano
- ignacio
- Site Admin
- Mensajes: 9253
- Registrado: Lun Abr 06, 2015 8:00 pm
- Ubicación: Madrid, Spain
- Contactar:
Re: SQLite Bug on date fields
Hi Juliano,emeasoft escribió:Thanks Ignacio! It worked now!
Just one more question, the date fields on the database created by the attach command are returning as char, not date as on the original table.
Is there any fix for this?
TIA,
Juliano
There is some extra work to do since the select clause you use does not give the necessary information. Change this code:
Código: Seleccionar todo
::dSQL:Execute( "CREATE TABLE LXTMP.TAB1 AS SELECT * FROM TAB1" )
Código: Seleccionar todo
Local aSql, aHead, cSql
::dSQL:Execute( "SELECT sql FROM SQLITE_MASTER WHERE TYPE = 'table' and upper( tbl_name ) = 'TAB1'",, @aSql )
cSql := Strtran( aSql[1,1], "CREATE TABLE TAB1", "CREATE TABLE LXTMP.TAB1" )
::dSQL:Execute( cSql ) // Creates the new table
::dSQL:QueryRow( "Select * from TAB1 LIMIT 1", @aHead )
cSql := "INSERT INTO LXTMP.TAB1("
AEval( aHead, {|v| cSql += v + "," } )
SwapChr( @cSql, Len( cSql ), ")" )
cSql += " SELECT * FROM TAB1"
::dSQL:Execute( cSql )
Re: SQLite Bug on date fields
Many thanks Ignacio! It is working very well now!!
Regards,
Juliano
Regards,
Juliano