is it possible to access the SQLite function creation routines through UniDac to extend the features available whe writing queries
http://www.sqlite.org/c3ref/create_function.html
Thanks
SQLite function creation routines
Re: SQLite function creation routines
Hello,
To implement user functions, you can use the TLiteUtils.RegisterFunction method. For example:
To implement user functions, you can use the TLiteUtils.RegisterFunction method. For example:
Code: Select all
function test(InValues: array of Variant): Variant;
begin
Result := 'new text';
//required behavior implementation
end;
procedure TForm14.FormCreate(Sender: TObject);
begin
TLiteUtils.RegisterFunction(UniConnection1, 'TEST', 1, test);
UniQuery1.SQL.Text := 'select TEXT(''old text'') as F_TEXT';
UniQuery1.DataTypeMap.AddFieldNameRule('F_TEXT', ftString);
UniQuery1.Open;
end;
Re: SQLite function creation routines
Thanks for the quick reply
Re: SQLite function creation routines
You are welcome. Feel free to contact us if you have any further questions.