How to improve the speed of sqlite

Discussion in 'Questions (Windows Mobile)' started by jeffrey8227, Sep 10, 2009.

  1. jeffrey8227

    jeffrey8227 Member Licensed User

    Code:
    j=1000
       con.BeginTransaction 
       
    For i=1 To 1000
             Cmd.CommandText =
    "update TBNR set XH='" & (j+1) & "' Where ( XH ='" & j & "')"
             j=j-
    1
             cmd.ExecuteNonQuery
       
    Next i
       con.EndTransaction
    In my HTC touch pro to complete the above code to take about 10 seconds

    How to improve the speed?
     
  2. jeffrey8227

    jeffrey8227 Member Licensed User

    Who can help me?
     
  3. Erel

    Erel Administrator Staff Member Licensed User

    SQL is powerful.
    Try something like:
    Code:
    cmd.CommandText = "update TBNR set XH=XH+1 where XH <= 1000"
        cmd.ExecuteNonQuery
     
  4. jeffrey8227

    jeffrey8227 Member Licensed User

    Thanks Erel
    I'll try it
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice