Re: [sqlite] sqlite3_create_function in delphi
They said it works only with plain (7-bit) ascii, no UTF. Dennis Cote wrote: Miha Vrhovnik wrote: Does anybody know how to add custom function to sqlite3 in Delphi? Cariotoglou Mike? I'd like to add function 'Lower' so I can match case insenisitive text columns in table. Regards, Miha There is a already a function lower() built in to SQLite. It returns a lowercase copy of a string. Dennis Cote
Re: [sqlite] sqlite3_create_function in delphi
Miha, what wrapper/library are you using? The following works for me (free). In your case, you need to change the sqlite3_result_int with sqlite3_result_text and pass the correct parameters to 'lower case' your var: - - - - - - - PROCEDURE fn(ctx:pointer;n:integer;args:ppchar);cdecl; VAR p : ppchar; theString : string; res:integer; BEGIN p := args; theString := trim(sqlite3_value_text(p^)); ...do something with theString... sqlite3_result_int(ctx,res); // < return a number based on string END; ... var i:integer; begin i := sqlite3_create_function(db3,'myfn',1,SQLITE_UTF8,nil,@fn,nil,nil); s := 'select myfn(thestring) from theTable;' ...execute statement... end; - - - - - - Miha Vrhovnik wrote: Does anybody know how to add custom function to sqlite3 in Delphi? Cariotoglou Mike? I'd like to add function 'Lower' so I can match case insenisitive text columns in table. Regards, Miha
Re: [sqlite] sqlite3_create_function in delphi
Miha Vrhovnik wrote: Does anybody know how to add custom function to sqlite3 in Delphi? Cariotoglou Mike? I'd like to add function 'Lower' so I can match case insenisitive text columns in table. Regards, Miha There is a already a function lower() built in to SQLite. It returns a lowercase copy of a string. Dennis Cote
Re: [sqlite] sqlite3_create_function in delphi
Hello Miha Vrhovnik, my DISQLite3 package for Delphi contains a unit named DISQLite3Collations.pas which contains various collation callback functions to implement Unicode / WideString and ANSI string comparisons, both with and without case sensitivity, based on the current user's locale: http://www.yunqa.de/delphi/sqlite3/ The same collation functions are also being used in SQLiteSpy, my free SQLite database explorer, browser, and manager: http://www.yunqa.de/delphi/sqlitespy/ Regards, Ralf >>There is a "nocase" collation for that purpose. > >Which works only on ASCII characters I need unicode version of Lower function.
Re: [sqlite] sqlite3_create_function in delphi
juan perez <[EMAIL PROTECTED]> je ob 3.12.2005 17:16:00 napisal(a): >There is a "nocase" collation for that purpose. > >jp Which works only on ASCII characters I need unicode version of Lower function. Regards, Miha
Re: [sqlite] sqlite3_create_function in delphi
There is a "nocase" collation for that purpose. jp Miha Vrhovnik wrote: Does anybody know how to add custom function to sqlite3 in Delphi? Cariotoglou Mike? I'd like to add function 'Lower' so I can match case insenisitive text columns in table. Regards, Miha
[sqlite] sqlite3_create_function in delphi
Does anybody know how to add custom function to sqlite3 in Delphi? Cariotoglou Mike? I'd like to add function 'Lower' so I can match case insenisitive text columns in table. Regards, Miha