Android Question Progressbar with SQLite NonQuery

Kiran Raotole

Active Member
Licensed User
Hi Experts,

This is SQlite Update Code
B4X:
    Dim count,limit,offset As Int
    count = db.ExecQuerySingleResult($"select count(*) from a"$)
    limit = 100
    offset = 0
    Do While offset < count
        db.ExecNonQuery( _
            $"UPDATE a SET amt= (update sum values here)
                WHERE condition and
                      ROWID IN (SELECT ROWID FROM a WHERE LIMIT ${offset},${limit})"$)
           
        Log("LIMIT : " & limit & "    OFFSET : " & offset & "  Time : " & DateTime.Time(DateTime.Now))
        show_progressbar_new(offset / count * 100)
        offset = offset + limit
    Loop

show_progressbar_new
B4X:
    Log("show_progressbar_new : " & progress)
    pnlProgress.Visible = True
    B4XProgressBar1.Progress = progress

show_progressbar_new is running but not showing Progress status of B4XProgressBar1.Progress
If I put sleep(0) in loop then progressbar progress start showing but function completed instantly without finish whole loop

What should I do....?
 
Last edited:
Top