Hi,
This is my first post here after purchasing this wonderful software.
I am totally new to B4A by the way
Here is my question:
I am trying to import an csv file to a database.
Loading the CSV file to a List works fine, inserting all the data into a table doesn't work. Ofcourse I am doing something wrong, but I can't figure out what.
(The csv file has 14 columns and about 3500 rows)
Any help is appreciated
This is my first post here after purchasing this wonderful software.
I am totally new to B4A by the way
Here is my question:
I am trying to import an csv file to a database.
Loading the CSV file to a List works fine, inserting all the data into a table doesn't work. Ofcourse I am doing something wrong, but I can't figure out what.
(The csv file has 14 columns and about 3500 rows)
Any help is appreciated
B4X:
List1 = StringUtils1.LoadCSV(File.DirAssets, "test.csv", "";"")
If FirstTime Then
SQL1.Initialize(File.DirAssets, "test1.db", True)
End If
SQL1.ExecNonQuery("DROP TABLE IF EXISTS table1")
SQL1.ExecNonQuery("CREATE TABLE table1 (col_1 TEXT ,col_2 TEXT ,col_3 TEXT ,col_4 TEXT ,col_5 TEXT ,col_6 TEXT ,col_7 TEXT ,col_8 TEXT ,col_9 TEXT ,col_10 TEXT ,col_11 TEXT ,col_12 TEXT ,col_13 TEXT ,col_14 TEXT)")
SQL1.BeginTransaction
For I = 0 To List1.Size-1
SQL1.ExecNonQuery2("INSERT INTO table1 VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?)", Array As Object(List1.Get(I))
Next I
SQL1.EndTransaction