Android Question Send multiple SQL statements to remote MySQL

Adie

Member
Licensed User
Longtime User
I saw it somewhere on the forum but now cant find it.

I need to send multiple UPDATE commands to the remote MySQL server.

EDIT: I use the standard JOB.poststring/JobDone as per sample in forum

Something like this:
"update mytable set field1 = " & Var1 & " where field2 = " & VarA & ";"
"update mytable set field1 = " & Var1 & " where field2 = " & VarB & ";"
"update mytable set field1 = " & Var1 & " where field2 = " & VarC & ";"
"update mytable set field1 = " & Var1 & " where field2 = " & VarD & ";"

I can vaguely remember a JSON parameter must be passed somewhere.

Regards
Adie
 
Last edited:

eps

Expert
Licensed User
Longtime User
How do you execute a single update? via a job? You could serialise these calls... especially if each one needs to complete before the next one can be executed.

Although they don't look mutually exclusive.

There is this... https://www.b4x.com/android/forum/threads/b4x-sql-with-wait-for.79532/ in the newer version of b4x

or this? https://www.b4x.com/android/forum/t...ring-via-job-download2-to-a-php-script.50919/

or this? https://www.b4x.com/android/forum/t...ry-after-first-is-complete.79627/#post-504279
 
Upvote 0

Adie

Member
Licensed User
Longtime User
How do you execute a single update? via a job? You could serialise these calls... especially if each one needs to complete before the next one can be executed.

Although they don't look mutually exclusive.

There is this... https://www.b4x.com/android/forum/threads/b4x-sql-with-wait-for.79532/ in the newer version of b4x

or this? https://www.b4x.com/android/forum/t...ring-via-job-download2-to-a-php-script.50919/

or this? https://www.b4x.com/android/forum/t...ry-after-first-is-complete.79627/#post-504279

None of the above is relevant as far as I can see. Either for local SQLite or even my own post.

Basically I do not want to send 50 job.PostString("https://qwerty.com/android/rserver.php", Query) 's to the cloud with all the overhead.
Just ONE 'semicolon seperated list' where each SQL line is executed by the MySQL server. Unless the connection to the cloud is broken the update can not fail. (We are using it for more than 10 years with MySQL)

Thinking about it, all I need to send a LIST of SQL strings and the DBMS must process them one line at a time as if it was send with 50 job.poststring's
"update mytable set field1 = 1 where field2 = 45;"
"update mytable set field1 = 1 where field2 = 58;"
"update mytable set field1 = 1 where field2 = 150;"
"update mytable set field1 = 1 where field2 = 10;"

Adie
 
Upvote 0
Top