0

I'm trying to find out what's the way to do a search from my xcode app to a BBDD in SQlite discarding the text punctuation.

Any comments are appreciated.

Thanks!

EDIT:

In the documentation of SQLite I have found this out:

int sqlite3_create_collation(
  sqlite3*, 
  const char *zName, 
  int eTextRep, 
  void *pArg,
  int(*xCompare)(void*,int,const void*,int,const void*)
);
int

and this from xcode:

sqlite3_create_collation(sqlite3 *, const char *zName, int eTextRep, <void *pArg, int (*xCompare)(void *, int, const void *, int, const void *));

But I don't know how to implement this collation from the xcode to get something like this working:

SELECT * FROM users WHERE name LIKE "más" COLLATE NOACCENTS

Can someone give me a helping hand?

Thanks

Samael
  • 21
  • 4
  • 1
    What kind of answer are you looking for? An SQL query that returns records matching a certain search string with certain characters disregarded? Post at least an example of a few records showing which ones should and shouldn't be returned, and a basic description of the algorithm you want to implement. – Larry Lustig Jul 26 '13 at 20:29
  • I'm looking for get this result: If I search for: "mas" I want to find: "mas" and "más" in my BBDD. I'm looking for a SQlite query that match this results, or the way to do it correctly – Samael Jul 27 '13 at 10:48
  • Try this previous answer: http://stackoverflow.com/questions/14009261/sqlite-accent-insensitive-search. (Those are not punctuation characters you want to discard, but rather different characters you want to fold together in the collation sequence). – Larry Lustig Jul 28 '13 at 12:04

0 Answers0