Adie Member Licensed User Longtime User May 17, 2017 #1 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: May 17, 2017
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
eps Expert Licensed User Longtime User May 17, 2017 #2 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
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
Adie Member Licensed User Longtime User May 17, 2017 #3 eps said: 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 Click to expand... 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
eps said: 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 Click to expand... 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
KMatle Expert Licensed User Longtime User May 18, 2017 #4 See the (my) example (link #2). Just send a list (= array) with maps (1 map = 1 row to update). In the php script just process the array in a loop and update. Easy. Upvote 0
See the (my) example (link #2). Just send a list (= array) with maps (1 map = 1 row to update). In the php script just process the array in a loop and update. Easy.
Erel B4X founder Staff member Licensed User Longtime User May 18, 2017 #5 Adie said: I need to send multiple UPDATE commands to the remote MySQL server. Click to expand... Switch to RDC. It supports batch commands. Upvote 0
Adie said: I need to send multiple UPDATE commands to the remote MySQL server. Click to expand... Switch to RDC. It supports batch commands.