[fpc-pascal] fpc and Sqlite UDF

Luiz Americo Pereira Camara luizmed at oi.com.br
Fri Nov 6 15:46:39 CET 2009


Luiz Americo Pereira Camara escreveu:
> Nataraj S Narayan escreveu:
>> Luiz
>>
>> Got it compiled for arm after putting libsqlite in proper path. 
>> Getting this:-
>>
>> # ./testfunction
>>
>> ./testfunction: can't resolve symbol 'dl_iterate_phdr'
>>   
>
> I have no clue what's the problem. Maybe someone else can help

It should not be sqlite3?
>
>> BTW, this function should be compiled to a lib.so  first? Then call it
>> in a trigger ?
>>   
>
> No.
>
> In the example a custom function (strftime) is registered with 
> sqlite3_create_function.
> After this you can call in a Select. (See example in the same file).
>
> So the only thing that you need is to call sqlite3_create_function in 
> the start of your program with the correct parameters.

Sorry. It's not in the start of the program. Is just about the first 
time the SqliteHandle is allocated. In the recent TSqliteDataset there's 
the OnGetHandle event that's the best place to put this kind of code. 
But if you are using older versions than you can call after the first 
Open or do a dummy ExecSql call to force the SqliteHandle allocation

Luiz



More information about the fpc-pascal mailing list