SQLCreateTable and sorting

Discussion in 'Questions (Windows Mobile)' started by N1c0_ds, Feb 13, 2009.

  1. N1c0_ds

    N1c0_ds Active Member Licensed User

    Right now I have a CSV file I'm trying to export to SQLite and I can't figure out how to pre-sort records in the table. Currently they are sorted by AppID (the first field name alphabetically) instead of by name (the "Name" field).

    Using table.sort before using createSQLtable doesn't work. However I did it before as the previous database is sorted by name and I recall fixing this problem.
  2. RB Smissaert

    RB Smissaert Well-Known Member Licensed User

    In a SQL database the concept of the data being sorted is less applicable as the order only matters when you do a select and with that you can do an order by. So, maybe leave as it is and do the order by when doing the select.

  3. N1c0_ds

    N1c0_ds Active Member Licensed User

    But I did it before! I recall having a sorting problem with the first database and now the latest database is correctly sorted. I'm trying to replicate this feat. :sign0085:

    OH! I might remember!

    Could it be that I saved it in a dummy SQL DB and called it with SORT and saved it in a new DB? I'm trying that as soon as I'm home :)

    Getgecko.org for more info ;)
  4. RB Smissaert

    RB Smissaert Well-Known Member Licensed User

    That might be one way, but unless there is a performance problem with it why not do the sort in the select order by?

  5. N1c0_ds

    N1c0_ds Active Member Licensed User

    That's what I did :p

    1-Export table to dummy SQL table
    2-Load table with ORDER BY
    3-Save in new table

    It's much better to sort them now than to have to slow down the process later. It's used to display applications in the list form in Gecko so every millisecond counts :)
  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