Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ SQL » [SQLITE] Search accents insensitive (How to select records without sensivity to the case and accents ?)
Re: [SQLITE] Search accents insensitive [message #48395 is a reply to message #48198] Fri, 30 June 2017 11:12 Go to previous message
jibe is currently offline  jibe
Messages: 294
Registered: February 2007
Location: France
Experienced Member
Hi,

Ooops !

extern "C" {
	void Sqlite3NoAccents(sqlite3_context *context, int argc, sqlite3_value **argv) {
		String str = RemoveAccents((const char*)sqlite3_value_text(argv[0]));
		sqlite3_result_text(context, ~str, str.GetCount(), SQLITE_TRANSIENT);
		return;
	}
}

void (*pSqlite3NoAccents)(sqlite3_context *, int, sqlite3_value **);
Sqlite3Session sqlite3;
::sqlite3* sqlite3db = (::sqlite3*)(Sqlite3Session::sqlite3*)sqlite3;
sqlite3_create_function(sqlite3db, "NoAccents", 1, SQLITE_ANY, 0, pSqlite3NoAccents, 0, 0);

is surely a lot better ! The compiler accepts it very well, but stays a
/home/joseph/uppMyApps/Owl/book.cpp (2891): error: 'NoAccents' was not declared in this scope


Seems normal that the compiler complains, but I don't know how to declare it...

The sqlite3_create_function is called in main(), when I use the "NoAccents" (Sqlite3NoAccents) in a dialog box...
w = (Like ((SqlId)NoAccents((SqlId)("TITLE")),"%" + AsString(~str) + "%"));
book.Query(w);

(book is a SqlArray in the dialog's layer)

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Please Help Me
Next Topic: Oracle 12c
Goto Forum:
  


Current Time: Sun Apr 28 16:18:28 CEST 2024

Total time taken to generate the page: 0.69478 seconds