Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

SQL Lite ordering accented characters
Started by freid Apr 22 2019 02:17 AM

1 reply to this topic
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

freid

[GLOBAL: userInfoPane.html]
freid
  • Observer

  • 8 posts
  • Corona SDK

Hi Corona lovers,

 

I have a sqlite database, and i need to order by a column that haves some words starting by a accented character. These items are being ordered wrong, they are appearing on the end of the results.

 

I saw some tips there :

https://stackoverflow.com/questions/19906086/problems-ordering-sqlite-by-a-column-with-accented-characters-Á

 

where someone suggest :

 

ORDER BY <field> COLLATE LOCALIZED

 

or even :

ORDER BY <field> COLLATE UNICODE

 

But i get this error :

 

No such collation sequence: (localized / unicode)

 

Do you have any ideas or suggestion ?

 

In my case i can maybe write some exceptions commands but of course its clumsy.

 

Thank you in advance guys :)



[TOPIC: post.html]
#2

freid

[GLOBAL: userInfoPane.html]
freid
  • Observer

  • 8 posts
  • Corona SDK

Well, the fastest workaround that i found is use 2 dedicated fields in my database : one for sorting without accents and the other one to display accents :)




[topic_controls]
[/topic_controls]