Re: [sqlite] about addition extension

2008-04-10 Thread dark0s dark0s
bash-3.1# nm libsqlite3.so.0.8.6| grep extension nm: 'libsqlite3.so.0.8.6': No such file bash-3.1# nm libsqlite3.so.0.8.6 nm: 'libsqlite3.so.0.8.6': No such file Ok, I downloaded sqlite-amalgamation-3.5.7. I've untar above file. Can you tell me step by step how to configure and com

Re: [sqlite] about addition extension

2008-04-10 Thread Ken
You need to see if you have the extensions compiled into the sqlite library. Run the fillowing: nm libsqlite3.so.0.8.6 | grep extension Output should be similar too: 00024a40 T sqlite3_auto_extension 000249d0 T sqlite3_enable_load_extension 00024680 T sqlite3_load_extensio

[sqlite] about addition extension

2008-04-10 Thread dark0s dark0s
.load is not present in my shell sqlite3 as command! bash-3.1# sqlite3 SQLite version 3.5.7 Enter ".help" for instructions sqlite> .load unknown command or invalid arguments: "load". Enter ".help" for help sqlite> .help .bail ON|OFF Stop after hitting an error. Default OFF .databases

[sqlite] about addition extension

2008-04-10 Thread dark0s dark0s
I created half.c program, the output is: bash-3.1# gcc -shared half.c -o half.so bash-3.1# sqlite3 SQLite version 3.5.7 Enter ".help" for instructions sqlite> .load half.so unknown command or invalid arguments: "load". Enter ".help" for help sqlite> select load_extension('half.so'); SQL error: no

Re: [sqlite] about addition extension

2008-04-09 Thread Dennis Cote
Ken wrote: > > Recomend getting the example from the wiki working first then move on to your > own. > That's good advice. Also, it would be better if you post your messages as replies to one of the existing message threads you have already started on this topic (rather than starting a new t

Re: [sqlite] about addition extension

2008-04-09 Thread Ken
1. remove main. 2. compile file with -shared (to create a .so) 3. select loadd_extension('filename.so') ; This will load your .so into the address space. 4. Use your function in a sql statement. Recomend getting the example from the wiki working first then move on to your own. HTH, Ken d

[sqlite] about addition extension

2008-04-09 Thread dark0s dark0s
Ok, but I did not understand step by step how work. In wiki there is: #include SQLITE_EXTENSION_INIT1 static void halfFunc( sqlite3_context *context, int argc, sqlite3_value **argv ){ sqlite3_result_double(context, 0.5*sqlite3_value_double(argv[0])); } int sqlite3_extension_init( s