I am attempting to insert records from a local SQLite table to a remote MySQL database table.
I can insert single records (with multiple fields) with no problem.
What I now need to accomplish is sending multiple records from the SQLite table.
Is the following code correct, or is there a more efficient/correct method:
I can insert single records (with multiple fields) with no problem.
What I now need to accomplish is sending multiple records from the SQLite table.
Is the following code correct, or is there a more efficient/correct method:
B4X:
Dim Curs As Cursor
Curs = Starter.SQL0.ExecQuery("SELECT * FROM bookstime")
Curs.Position = 0
For i = 0 To Curs.RowCount - 1
Curs.Position = i
username = Curs.GetString("username")
booktitle = Curs.GetString("booktitle")
userid = Curs.GetString("userid")
isbn = Curs.GetString("isbn")
date = Curs.GetString("date")
booktime = Curs.GetString("booktime")
Dim cmd As DBCommand
cmd.Initialize
cmd.Name = "insert_bookstime"
cmd.Parameters = Array As Object(Null, username, booktitle, userid, isbn, date, booktime )
reqManager.ExecuteCommand(cmd, "insert_bookstime")
Next