[sqlite] SQL error: no such function: and no such column:

2008-04-13 Thread dark0s dark0s
bash-3.1# gcc -shared labsinf.c -o inf.so bash-3.1# sqlite3 SQLite version 3.5.7 Enter .help for instructions sqlite select load_extension('/root/inf.so'); sqlite select inf(savio); SQL error: no such column: savio sqlite select inf('savio'); SQL error: no such function: inf sqlite I tell help

[sqlite] segmentation fault

2008-04-13 Thread dark0s dark0s
This is last suggestion that I tell, where is the problem now for segmentation fault: bash-3.1# gcc -shared labsinf.c -o soundex.so bash-3.1# sqlite3 SQLite version 3.5.7 Enter .help for instructions sqlite select load_extension('/root/soundex.so'); sqlite select soundex('saverio'); S010

[sqlite] segmentation fault

2008-04-13 Thread dark0s dark0s
How must I interpret this output: bash-3.1# gcc -O0 -g -shared labsinf.c -o soundex.so bash-3.1# gdb sqlite3 GNU gdb 6.6 Copyright (C) 2006 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of

[sqlite] segmentation fault

2008-04-13 Thread dark0s dark0s
I did not used never gdb. Can I post me commands that I must to use (gdb) run sqlite3 Starting program: sqlite3 No executable file specified. Use the file or exec-file command. (gdb) run select load_extension('/root/soundex.so'); Starting program: select load_extension('/root/soundex.so'); No

[sqlite] extension don't return value

2008-04-12 Thread dark0s dark0s
The soundex function don't return results of your processing. My output is below: bash-3.1# gcc -shared labsinf.c -o inf.so bash-3.1# sqlite3 SQLite version 3.5.7 Enter .help for instructions sqlite select load_extension('/root/inf.so') ... select inf(savio) ... I don't understand where is

[sqlite] extension don't return value

2008-04-12 Thread dark0s dark0s
I modified row in function: sqlite3_result_text(ctx,(const char*)ret, 4, SQLITE_TRANSIENT); I know that dimension is 4, but my shell don't return values for extension function also with half.c example copied from wiki: bash-3.1# gcc -shared half.c -o half.so bash-3.1# sqlite3 SQLite version

[sqlite] error in sqlite3_extension_init

2008-04-11 Thread dark0s dark0s
Excuse me for my stupid topic, but I am crazying to find error in program below. My output is: bash-3.1# gcc -shared labsinf.c -o inf.so labsinf.c:61: error: expected ';', ',' or ')' before '*' token The errror is for sqlit3_extension_init row, but I don't see strange things #include stdio.h

[sqlite] error in sqlite3_extension_init

2008-04-11 Thread dark0s dark0s
But I don't understand where is the error in row below: int sqlite3_extension_init(sqlite3 *db, char **pzErrMsg, const sqlite3_api_rountines *pApi) { Can some suggest me something? - #include stdio.h #include stdlib.h #include string.h #include

[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 such

[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

Re: [sqlite] about addition extension

2008-04-10 Thread dark0s dark0s
)... sqlite .load half.so This is correct: except you need to provide the FULL path name! SELECT load_extension('half.so'); dark0s dark0s [EMAIL PROTECTED] wrote: 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

[sqlite] cannot open shared file object: no such file or directory

2008-04-10 Thread dark0s dark0s
Ok, I build sqlite3 with load extension support, now I must execute extension: #gcc -shared half.c -o half.so #export LD_LIBRARY_PATH='pwd' #sqlite3 sqlite.load half.so half.so: cannot open shared file object: no such file or directory but #ls half.c half.so Where is the problem now? Savio

[sqlite] Addition extension function failed!

2008-04-09 Thread dark0s dark0s
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. The program labsinf.c make inf, and after I typed ./inf, it makes dbforext.db. Some output is

[sqlite] Addition extension function failed!

2008-04-09 Thread dark0s dark0s
Ok, but I did not understand step by step how work. In wiki there is: #include sqlite3ext.h 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

[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 sqlite3ext.h 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

[sqlite] passing parameters in sql strings

2008-04-08 Thread dark0s dark0s
How can I to pass parameters in sql string? For example, I type: sql = create table modulo(id, nome, classe, istanza);; now, I'd like to insert a parametrized name for table. Like echo 'create table $modulo(id, nome, classe, istanza)' in shell scripting.

[sqlite] for function extension in sqlite3

2008-04-08 Thread dark0s dark0s
Hi all, I'd like write extension for sqlite3 creating soundex function like below: void soundex() { ... ... } int main(int argc, char* argv[]) { int rc; sqlite3* db; rc = sqlite3_open(dbforext.db,db); if (rc) { fprintf(stderr, E' impossibile aprire il file %s\n,

[sqlite] help about extension

2008-04-08 Thread dark0s dark0s
I need help. I am doing sqlite3 extension, but something don't work at compile time. The output of compiler is: bash-3.1# gcc -lsqlite3 labsinf.c -o inf labsinf.c: In function 'soundex': labsinf.c:16: warning: assignment discards qualifiers from pointer target type The program is below, I am

Re: [sqlite] for function extension in sqlite3

2008-04-08 Thread dark0s dark0s
I must create a extension for a exam. I don't want know how work soundex, but how make a extension D. Richard Hipp [EMAIL PROTECTED] ha scritto: On Apr 8, 2008, at 12:57 PM, dark0s dark0s wrote: Hi all, I'd like write extension for sqlite3 creating soundex function like below: SQLite

Re: [sqlite] for function extension in sqlite3

2008-04-08 Thread dark0s dark0s
Your assignment above discards the const qualifier. It also ignores the fact that the types differ in their signedness. You should change your str variable to be a const char pointer, and then explicitly cast away the unsigned qualifier. const char *str; str = (const

Re: [sqlite] for function extension in sqlite3

2008-04-08 Thread dark0s dark0s
No, it don't work, the output is: bash-3.1# gcc -lsqlite3 labsinf.c -o inf labsinf.c: In function 'soundex': labsinf.c:18: error: assignment of read-only location labsinf.c:22: error: assignment of read-only location labsinf.c:27: error: assignment of read-only location labsinf.c:31: error:

[sqlite] problem with sqlite3_bind_text

2008-04-07 Thread dark0s dark0s
Hi all, after writing my program, I typed: bash-3.1# gcc -lsqlite3 CreaDB.c -o creadb CreaDB.c: In function 'main': CreaDB.c:35: error: too few arguments to function 'sqlite3_bind_text' CreaDB.c:36: error: too few arguments to function 'sqlite3_bind_text' CreaDB.c:37: error: too few arguments to

[sqlite] problem with undefined reference

2008-04-05 Thread dark0s dark0s
Hi all, I am newbye in sqlite programming. I written a little C program to begin with sqlite, and I posted it below: #include stdio.h #include stdlib.h #include sqlite3.h void main() { int rc, i; sqlite3* db; sqlite3_stmt* stmt; char* sql; const char* tail; rc =

[sqlite] problem with undefined reference

2008-04-05 Thread dark0s dark0s
Ok, excuse my ignorance, how can I to connect dinamic library with gcc Thanks, savio - Inviato da Yahoo! Mail. La casella di posta intelligente. ___ sqlite-users mailing list sqlite-users@sqlite.org

[sqlite] problem with undefined reference

2008-04-05 Thread dark0s dark0s
sqlite3.c is not present in the system I type gcc CreaDB.c sqlite3.c -o CreaDB but after I don't find CreaDB also in my system. savio - Inviato da Yahoo! Mail. La casella di posta intelligente. ___

Re: [sqlite] problem with undefined reference

2008-04-05 Thread dark0s dark0s
at end of file bash-3.1# ls CreaDB.c Desktop GNUstep loadlin16c.txt bash-3.1# What is the problem? CreaDB is not present Amit Uttamchandani [EMAIL PROTECTED] ha scritto: On Sat, 5 Apr 2008 18:16:47 +0200 (CEST) dark0s dark0s wrote: Hi all, I am newbye in sqlite programming. I written a little

Re: [sqlite] problem with undefined reference

2008-04-05 Thread dark0s dark0s
-in function 'strlen' CreaDB.c:5: warning: return type of 'main' is not 'int' CreaDB.c:41:3: warning: no newline at end of file bash-3.1# ls CreaDB.c Desktop GNUstep loadlin16c.txt dark0s dark0s [EMAIL PROTECTED] ha scritto: bash-3.1# gcc CreaDB.c sqlite3.c -o CreaDb gcc: sqlite3.c: No such file

[sqlite] problem with undefined reference

2008-04-05 Thread dark0s dark0s
What did you download from http://www.sqlite.org/download.html ? sqlite-3.5.7.so.gz, or sqlite-amalgamation-3.5.7.tar.gz? I've installed sqlite-3.5.7 precompiled package on my slackware system. Below there is results of searches: bash-3.1# find / -name sqlite3.c bash-3.1# bash-3.1# find /