but i found the answer
change Str from
Str ="insert into tbla (a,b,c) values('a','b','c');insert into tbla (a,b,c) values('d','e','f');insert into tbla (a,b,c) values('f','g','h');"
to
Str ="insert into tbla (a,b,c) values('a','b','c'),('d','e','f'),('f','g','h')"
It is a lot easier to use a parameterized query like this, less prone to error:
B4X:
Dim str As String
str="INSERT INTO tbla VALUES(?,?,?), (?,?,?), (?,?,?)"
SQL1.ExecNonQuery2(str, Array As Object("a","b","c","d","e","f","g","h","i") )
His idea is sound. I have used that approach. It works well and the same way as using many separate INSERT statements as long as he uses a transaction. All he is trying to do is have one insert statement for several records insertions. There is no gain or loss of speed. But, I will let him explain his point of view.
His idea is sound. I have used that approach. It works well and the same way as using many separate INSERT statements as long as he uses a transaction. All he is trying to do is have one insert statement for several records insertions. There is no gain or loss of speed. But, I will let him explain his point of view.
Hi @Mahares I'm not quibbling on the technical aspect, but the need to perform this processing - it doesn't sound right to me - but then we don't know the intended use or problem being solved here.
@Mahares : thank you for your answer.. @eps : i try download data from server (more than 10.000 rows (Mysql)) and insert into my local database (SQLite) @Erel : thank you, transaction will be my favorite (faster than i think)
I try with transaction and
he result is faster than i need