K kgf Member Licensed User Longtime User Aug 13, 2018 #1 I have got Jrdc working and would like to copy records from sqlite tables on the host to matching sqlite tables on the device. I need to do this for a number of tables and looking for the best way to do this. I can log a result using req.PrintTable(res) and was thinking of using DBUtils.InsertMaps(SQL, "table", ListOfMaps) to add the records but unsure of the best way of turning the result into a list of maps. Is DBUtils a good way of doing this and if so what is the best way to turn the result into a ListOfMaps. Will be copying a number of tables with varying amounts of columns. Thanks
I have got Jrdc working and would like to copy records from sqlite tables on the host to matching sqlite tables on the device. I need to do this for a number of tables and looking for the best way to do this. I can log a result using req.PrintTable(res) and was thinking of using DBUtils.InsertMaps(SQL, "table", ListOfMaps) to add the records but unsure of the best way of turning the result into a list of maps. Is DBUtils a good way of doing this and if so what is the best way to turn the result into a ListOfMaps. Will be copying a number of tables with varying amounts of columns. Thanks
Erel B4X founder Staff member Licensed User Longtime User Aug 13, 2018 #2 DBUtils.InsertMaps is a good option. Something like: Code: Copy Dim maps As List maps.Initialize For Each row() As Object In res.Rows maps.Add(CreateMap("column1": row(res.Columns.Get("column1")), "column2": row(res.Columns.Get("column2"))) Next 'now insert maps Upvote 0
DBUtils.InsertMaps is a good option. Something like: Code: Copy Dim maps As List maps.Initialize For Each row() As Object In res.Rows maps.Add(CreateMap("column1": row(res.Columns.Get("column1")), "column2": row(res.Columns.Get("column2"))) Next 'now insert maps
K kgf Member Licensed User Longtime User Aug 13, 2018 #3 Thanks, make sense now I see an example Upvote 0