dark0s dark0s wrote:
> I have a new problem, I am attempting add extension function to sqlite3.
> My program labsinf.c now build successfully, but I didn't add my extension. I 
> don't understand what it is miss.
> Help me please.
> 
> 
> bash-3.1# gcc -lsqlite3 labsinf.c -o inf
> bash-3.1# ./inf
> bash-3.1# sqlite3 dbforext.db
> SQLite version 3.5.7
> Enter ".help" for instructions
> sqlite> select soundex();
> SQL error: no such function: soundex

The sqlite3_create_function() call create a function that is available 
to the database connection used in the create call only. Your function 
is available in your inf program after it is created, but is no longer 
available after it exits. The sqlite3 command shell does not know 
anything about your custom function, so it can't be used there.

You need to create a loadable extension module and load that into the 
shell for the function to be available in the shell. See 
http://www.sqlite.org/cvstrac/wiki?p=LoadableExtensions and the shell's 
.load commnad for additional info.

HTH
Dennis Cote

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to