Example:
My ForServer table has numerous records since the last time it connected to the server and sent the list of records.
The issue is ExecuteRemoteQuery (as demonstrated in MySQL tutorial) fires off each record without waiting for a response in JobDone (they come in time... and any order). It performs a select statement and returns a JSON string if the select query was found.
What I wish to achieve is to determine, for each record, if the query returned a match. Seems this is obvious because a JSON result was returned - but for which query sent (cause order is not guaranteed)?
I have read the many posts/pages concerning HttpUtils2 (some posts eluding to an answer) but have yet to find a solution.
If a Job.PostString would wait for a response, then one could deal with the request at hand.
I have introduced at timer that waits for 5 seconds after the request (with DoEvents as not to block) before proceeding to the next record - with mixed results (not shown below).
some code:
Now here is where the fun begins: determine which result we must deal with...(and mark it as already sent before I execute the INSERT method which shall Send all new records to the remote DB)
Wish there was an ExecuteRemoteQueryandWaitForResponse(Wait as milliseconds)
Thanks again... I so stumped
My ForServer table has numerous records since the last time it connected to the server and sent the list of records.
The issue is ExecuteRemoteQuery (as demonstrated in MySQL tutorial) fires off each record without waiting for a response in JobDone (they come in time... and any order). It performs a select statement and returns a JSON string if the select query was found.
What I wish to achieve is to determine, for each record, if the query returned a match. Seems this is obvious because a JSON result was returned - but for which query sent (cause order is not guaranteed)?
I have read the many posts/pages concerning HttpUtils2 (some posts eluding to an answer) but have yet to find a solution.
If a Job.PostString would wait for a response, then one could deal with the request at hand.
I have introduced at timer that waits for 5 seconds after the request (with DoEvents as not to block) before proceeding to the next record - with mixed results (not shown below).
some code:
B4X:
Dim c as cursor
c = Defs.SQL1.ExecQuery("Select * from ForServer WHERE Sent = 0") ' sent = false
c.Position = 0
For i = 0 To c.RowCount -1
c.Position = i
ExecuteRemoteQuery("SELECT * FROM Tasks WHERE PID ='"& c.GetLong("PK") & "' AND DT ='" &c.GetLong("DT") &"' AND Comp ='" & c.GetLong("Comp")&"'" ,COUNTRIES_LIST)
Next
c.close
Now here is where the fun begins: determine which result we must deal with...(and mark it as already sent before I execute the INSERT method which shall Send all new records to the remote DB)
Wish there was an ExecuteRemoteQueryandWaitForResponse(Wait as milliseconds)
Thanks again... I so stumped