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.

Write a delimited import routine for a Sqlite table, or import to dbf, then sql insert to sqlite?

Xailer professional forum in English
Responder
DC
Mensajes: 122
Registrado: Lun May 16, 2011 6:06 pm

Write a delimited import routine for a Sqlite table, or import to dbf, then sql insert to sqlite?

Mensaje por DC »

Hi,

I'm writing a routine to import two types of delimited files to sqlite tables. One of the files is pipe-delimited, and the other is tab-delimited.

It just occurred to me, that maybe I should import the files into a dbf table first, then insert them into sqlite without writing any import code.

I can do it either way, but how would you approach it? Would there be advantages to using Harbour's native APPEND FROM, e.g. speed?
Avatar de Usuario
ignacio
Site Admin
Mensajes: 9246
Registrado: Lun Abr 06, 2015 8:00 pm
Ubicación: Madrid, Spain
Contactar:

Re: Write a delimited import routine for a Sqlite table, or import to dbf, then sql insert to sqlite?

Mensaje por ignacio »

Hi DC,

It should be easy to do it with:

Código: Seleccionar todo

cLine := MemoLine( cData, nLine) 
aLine := Hb_aTokens( cLine, cSeparator )
I recommend to create the SQL string concatenating more than one INSERT operation (check SQLite docs if necessary). Do no exceed of 32 Kb for every multiple insert operation.

Regards
Ignacio Ortiz de Zúñiga
[Equipo de Xailer / Xailer team]
https://www.xailer.com
DC
Mensajes: 122
Registrado: Lun May 16, 2011 6:06 pm

Re: Write a delimited import routine for a Sqlite table, or import to dbf, then sql insert to sqlite?

Mensaje por DC »

Sounds good, I'll give it a try, thanks Ignacio.

Got one more question, related to the refreshing of a Listbox. Will open a different thread.
Avatar de Usuario
ignacio
Site Admin
Mensajes: 9246
Registrado: Lun Abr 06, 2015 8:00 pm
Ubicación: Madrid, Spain
Contactar:

Re: Write a delimited import routine for a Sqlite table, or import to dbf, then sql insert to sqlite?

Mensaje por ignacio »

Hi,

Sorry I do not understand your question. In any case you CAN NOT do any kind of painting from a thread. The last updating process must be done on the main thread.

I suggest you take a look of the Promises included in Xailer 7 and the sample \future\futuredemo.xpj

Regards,
Ignacio Ortiz de Zúñiga
[Equipo de Xailer / Xailer team]
https://www.xailer.com
DC
Mensajes: 122
Registrado: Lun May 16, 2011 6:06 pm

Re: Write a delimited import routine for a Sqlite table, or import to dbf, then sql insert to sqlite?

Mensaje por DC »

I posted the question, figured it out, and then removed it. The REFRESHes are working fine now.

(By 'thread', I mean the thread on the forum, not a thread in an application. Like this thread right here, abou delimited imports).

ignacio escribió: Jue May 06, 2021 10:47 am Hi,

Sorry I do not understand your question. In any case you CAN NOT do any kind of painting from a thread. The last updating process must be done on the main thread.

I suggest you take a look of the Promises included in Xailer 7 and the sample \future\futuredemo.xpj

Regards,
Avatar de Usuario
ignacio
Site Admin
Mensajes: 9246
Registrado: Lun Abr 06, 2015 8:00 pm
Ubicación: Madrid, Spain
Contactar:

Re: Write a delimited import routine for a Sqlite table, or import to dbf, then sql insert to sqlite?

Mensaje por ignacio »

:D :D :D :D :D
Ignacio Ortiz de Zúñiga
[Equipo de Xailer / Xailer team]
https://www.xailer.com
Responder