G GeoffT660 Active Member Licensed User Longtime User Jan 30, 2015 #1 I'm now able to download or stream with httputils2 and read csv files or stream xml through the xml parser but what is the fastest and most efficient way of reading 1000's of records with 30 or 40 fields from a csv file or the xml parser into a SQL Lite table. The Sql Lite table will have the exact same structure as the downloaded csv file or streamed xml. I will need to do this on many different tables. Is it better to receive the info as a .csv file and read and parse the file, delimited stream or xml stream and parse with the parser. Thanks.
I'm now able to download or stream with httputils2 and read csv files or stream xml through the xml parser but what is the fastest and most efficient way of reading 1000's of records with 30 or 40 fields from a csv file or the xml parser into a SQL Lite table. The Sql Lite table will have the exact same structure as the downloaded csv file or streamed xml. I will need to do this on many different tables. Is it better to receive the info as a .csv file and read and parse the file, delimited stream or xml stream and parse with the parser. Thanks.
Erel B4X founder Staff member Licensed User Longtime User Jan 30, 2015 #2 CSV will be faster than XML. The important point is to create a single transaction for all the insert statements. Upvote 0
CSV will be faster than XML. The important point is to create a single transaction for all the insert statements.
G GeoffT660 Active Member Licensed User Longtime User Jan 30, 2015 #3 Thanks, I'll work with that. Is the fastest way to create the csv file on the server and download it to the device and read it from the file or to read it as a string directly to the table or some other way. I can receive the input either way but have only figured out the former to read from a file. Any ideas on that? Is it also possible to create the SQL Lite table on the server and replace it on the device? Do you have an example of a single transaction created from a csv file or inputstream that would insert all the records en masse? Upvote 0
Thanks, I'll work with that. Is the fastest way to create the csv file on the server and download it to the device and read it from the file or to read it as a string directly to the table or some other way. I can receive the input either way but have only figured out the former to read from a file. Any ideas on that? Is it also possible to create the SQL Lite table on the server and replace it on the device? Do you have an example of a single transaction created from a csv file or inputstream that would insert all the records en masse?
Erel B4X founder Staff member Licensed User Longtime User Jan 30, 2015 #4 If you can create the SQLite database on the server then it is the simplest method. Just download the database file, close the existing SQL connection and replace the file. There are many examples in the forum of using transactions. Upvote 0
If you can create the SQLite database on the server then it is the simplest method. Just download the database file, close the existing SQL connection and replace the file. There are many examples in the forum of using transactions.