Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

SQLite - Ingore accents on SELECT
Started by Zau Feb 03 2015 07:31 AM

- - - - -
1 reply to this topic
sqlite ingore accents select database query
[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

Zau

[GLOBAL: userInfoPane.html]
Zau
  • Observer

  • 19 posts
  • Corona SDK

Hello,

 

I use database with the sqlite include/require, and I have a Search mechanism on my app. The problem is when I try to search (db:nrows(query) with the query being SELECT) something it doesnt return me the row where the title has any kind of accentuation.

 

For instance:

 

I do: SELECT * FROM table WHERE title LIKE "%agencia%"

And it returns 0 rows, even thought I have a row with "agência" on the title.

 

Any solution or "workaround" for this?

 

Thanks.



[TOPIC: post.html]
#2

Zau

[GLOBAL: userInfoPane.html]
Zau
  • Observer

  • 19 posts
  • Corona SDK

Good afternoon,

 

I found a way that works, so im using it now but it isnt 100% to my liking.

Its basically a workaround that I found on stackoverflow (http://stackoverflow.com/questions/5492508/ignore-accents-sqlite3 -- see second answer).

 

I dont like it because the query I have is already big, with a lot of columns, meaning that now with that workaround its gigantic, so if someone knows another way I appreciate it.

 

Thanks




[topic_controls]
[/topic_controls]