Hi all. 144 records get a text file and insert into a table from a sqlite database. This process takes 14 seconds. Is there any way to speed up the process?
The code is as follows:
Dim m AsMap
Dim Jsu AsStringUtils
Dim Table, ListOfMaps AsList
Log("Cargamos tabla " & DateTime.time(DateTime.Now))
'cargamos el contenido del fichero texto en una lista
Table.Initialize
Table = Jsu.LoadCSV("C:\General", "Ventas.txt", ";")
Log("Iniciamos grabacion registros " & DateTime.time(DateTime.Now))
For x = 0To Table.Size -1
Dim cells() AsString
cells = Table.get(x)
ListOfMaps.Initialize
m.Initialize
m.Put("Serie", cells(0))
m.Put("IdVenta", cells(1))
m.Put("Estado", cells(2))
m.Put("IdAlmacen", cells(3))
m.Put("IdEmpleado", cells(4))
m.Put("FormaDePago", cells(10))
m.Put("Fecha", cells(11))
m.Put("Hora", cells(12))
m.Put("IdProducto",cells(13))
m.Put("ID", cells(14))
m.Put("Formato", cells(15))
m.Put("Descripcion", "")
m.Put("Cantidad", cells(16))
m.Put("PrecioNUnidad", cells(17))
m.Put("PrecioUnidad", cells(18))
m.Put("Descuento", cells(19))
m.Put("IdCliente", cells(20))
'añado el mapa de campos a la lista
ListOfMaps.Add(m)
DBUtils.InsertMaps(Main.SQL1, "Ventas", ListOfMaps)
Next
Log("Fin grabacion registros " & DateTime.time(DateTime.Now))
thx.
The code is as follows:
Dim m AsMap
Dim Jsu AsStringUtils
Dim Table, ListOfMaps AsList
Log("Cargamos tabla " & DateTime.time(DateTime.Now))
'cargamos el contenido del fichero texto en una lista
Table.Initialize
Table = Jsu.LoadCSV("C:\General", "Ventas.txt", ";")
Log("Iniciamos grabacion registros " & DateTime.time(DateTime.Now))
For x = 0To Table.Size -1
Dim cells() AsString
cells = Table.get(x)
ListOfMaps.Initialize
m.Initialize
m.Put("Serie", cells(0))
m.Put("IdVenta", cells(1))
m.Put("Estado", cells(2))
m.Put("IdAlmacen", cells(3))
m.Put("IdEmpleado", cells(4))
m.Put("FormaDePago", cells(10))
m.Put("Fecha", cells(11))
m.Put("Hora", cells(12))
m.Put("IdProducto",cells(13))
m.Put("ID", cells(14))
m.Put("Formato", cells(15))
m.Put("Descripcion", "")
m.Put("Cantidad", cells(16))
m.Put("PrecioNUnidad", cells(17))
m.Put("PrecioUnidad", cells(18))
m.Put("Descuento", cells(19))
m.Put("IdCliente", cells(20))
'añado el mapa de campos a la lista
ListOfMaps.Add(m)
DBUtils.InsertMaps(Main.SQL1, "Ventas", ListOfMaps)
Next
Log("Fin grabacion registros " & DateTime.time(DateTime.Now))
thx.