SQLCreateTable and sorting

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.
 

RB Smissaert

Well-Known Member
Licensed User
Longtime 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.

RBS
 

N1c0_ds

Active 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.

RBS

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 ;)
 

RB Smissaert

Well-Known Member
Licensed User
Longtime User
Could it be that I saved it in a dummy SQL DB and called it with SORT and saved it in a new DB?

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

RBS
 

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 :)
 
Top