Android Question ExecQueryAsync and DELETE ... IN (1, 2, 3) not working?

Jeffrey Cameron

Well-Known Member
Licensed User
Longtime User
Using the new ExecQueryAsync method I execute the following SQL statement (AuditNum is an INTEGER column):
B4X:
DELETE FROM [MyTable] WHERE [AuditNum] IN (1, 2, 3);
The method executes without error, however the rows are not actually removed from the database. When I use the same exact SQL statement with the ExecNonQuery method it behaves as expected and removes the correct rows from the database.

Is this by design or did I overlook an ExecNonQueryAsync method somewhere?
 

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

Mahares

Expert
Licensed User
Longtime User
I think the proper code for you should be:
B4X:
SQL1.AddNonQueryToBatch("DELETE FROM [MyTable] WHERE [AuditNum] IN (?,?,?)", Array As Int (1,2,3) )
    Dim SenderFilter As Object = SQL1.ExecNonQueryBatch("SQL")
    Wait For (SenderFilter) SQL_NonQueryComplete (SuccessD As Boolean)
    If SuccessD Then
        Log("Deleted records in table: " & SuccessD)
    End If
 
Upvote 0
Top