Android Question ExecNonQuery vs ExecNonQueryBatch

MrKim

Well-Known Member
Licensed User
I have a delete statement I will run on a regular basis - multi user environment. I DON'T want to wait for it to finish. I tried running ExecNonQueryBatch with "" as the event and no event but it throws an error. So my question, does ExecNonQuery wait for the finish, or move on?

This is going to SQL Server and I just want to send it and forget it.

Thanks for your input.
 

OliverA

Expert
Licensed User
ExecNonQuery - Blocking
ExecNonQueryBatch - Non-blocking/async

Who says the event routine has to do anything?
B4X:
sql.AddNonQueryToBatch("DELETE FROM Temp WHERE id=?", Array As Object("1"))
sql.ExecNonQueryBatch("SQL_DoNothing")
...  
Sub SQL_DoNothing_NonQueryComplete (Success As Boolean)
    'Blank sub
End Sub
 

MrKim

Well-Known Member
Licensed User
ExecNonQuery - Blocking
ExecNonQueryBatch - Non-blocking/async

Who says the event routine has to do anything?
B4X:
sql.AddNonQueryToBatch("DELETE FROM Temp WHERE id=?", Array As Object("1"))
sql.ExecNonQueryBatch("SQL_DoNothing")
... 
Sub SQL_DoNothing_NonQueryComplete (Success As Boolean)
    'Blank sub
End Sub
Yes it doesn't need to do anything but the code will eventually come back to it. I was hoping to just pass it to SQL Server and move on.
 
Top