Hi to all
I have same problems to load a csv file into Mysql db.
This is the code
B4X:
sql.ExecNonQuery2("LOAD DATA INFILE " & namedir & "\" & namef & " INTO TABLE Products", Array As String("FIELDS TERMINATED BY ';'"))
this is the exception
B4X:
java.lang.Exception: java.sql.SQLException: Parameter index out of range (1 > number of parameters, which is 0).
Second test whitout arguments
B4X:
sql.ExecNonQuery("LOAD DATA INFILE " & namedir & "\" & namef & " INTO TABLE Products FIELDS TERMINATED BY ';'")
exception
B4X:
java.lang.Exception: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'F:\Progetti_SW_HW\B4J_Gest\products.csv INTO TABLE Products FIELDS TERMINATED' at line 1
tests also performed without quote char (')
Wher's the error?
Thanks
I have a vague memory of the possibility to disable indexes for a table and I was doing this when I had to insert a lot of records, then I did rebuild them.
Maybe I dream, because I do not remember what were the operating system, the DB and the language!
Anyway, I did some tests and that command works (I replied yesterday in the Italian forum: if this can be useful I can bring everything here).