[sqlite] undefined function sqlite_open()
Hello all, I've searched the list archive and didn't find any mention of this. Google has lots of hits, but every board posting with a resolution was left as 'resolved' with little explanation. :( I have clean install of Debian Etch with lighttpd, php5-cgi, php-sqlite3, xml_core, sqlite3, sqlite-doc installed and setup according to these instructions: http://trac.lighttpd.net/trac/wiki/TutorialLighttpdAndPHP phpinfo() shows all is well with php, and sqlite3 support is enabled (library version 3.3.8). My php script dies with "Fatal error: Call to undefined function sqlite_open() in /var/www/index.php on line 470" Line 470 is simply "$db = sqlite_open($db_path . $db_name) or die("Could not open database! Error on line: " . __LINE__);" The aforementioned 'resolved' posts indicated mod_rewrite was an/the issue, so I tried enabling that in lighttpd.conf with no change in results. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] Create table error on AIX -- Unable to open database "mytest": SQL logic error or missing database
Hi, I am having problems with SQLite v3.5.7 on AIX v5.2. I downloaded the amalgamation tarball. It looks like it builds fine, but I get an error when I try to create a table. Here's what I'm doing/getting: AIX$ ./sqlite3 test.db SQLite version 3.5.7 Enter ".help" for instructions sqlite> create table mytest(first smallint); Unable to open database "mytest": SQL logic error or missing database AIX$ I've searched the list's archives and seen some similar problems, but I have been unable to fix the problem. Looking through the config.log file I guess it's not building fine. Here are a few things from the log that may or may not help in troubleshooting: 1) configure:3025: cc -c -Os conftest.c >&5 "conftest.c", line 15.14: 1506-275 (S) Unexpected text me encountered. "conftest.c", line 15.8: 1506-045 (S) Undeclared identifier choke. configure:3031: $? = 1 configure: failed program was: | /* confdefs.h. */ | #define PACKAGE_NAME "sqlite" | #define PACKAGE_TARNAME "sqlite" | #define PACKAGE_VERSION "3.5.7" | #define PACKAGE_STRING "sqlite 3.5.7" | #define PACKAGE_BUGREPORT "http://www.sqlite.org; | #define PACKAGE "sqlite" | #define VERSION "3.5.7" | /* end confdefs.h. */ | | int | main () | { | #ifndef __GNUC__ |choke me | #endif | | ; | return 0; | } 2) configure:3279: cc -c -Os conftest.c >&5 "conftest.c", line 45.39: 1506-195 (S) Integral constant expression with a value greater than zero is required. configure:3285: $? = 1 configure: failed program was: | /* confdefs.h. */ 3) configure:3279: cc -qlanglvl=extc89 -c -Os conftest.c >&5 1506-173 (W) Option langlvl=extc89 is not valid. Enter xlc for list of valid op tions. "conftest.c", line 45.39: 1506-195 (S) Integral constant expression with a value greater than zero is required. I'm not sure if any of this is helpful or not. There are more errors like this. I can send the whole config.log if needed. Oh, the system has cc, but doesn't have gcc, FWIW. BTW, I used the Windows version to create a small test database that works fine in Windows, but when I try to use it with the AIX build I still get the error: AIX$ ./sqlite3 test.db Unable to open database "test.db": SQL logic error or missing database AIX$ Sorry for the long message, but if anyone could help I would greatly appreciate it. I'm not much of a C programmer, I'm rusty on *nix, and I'm not an admin on this system. Please let me know if there is other information I need to send that might help in fixing the problem (or if I'm just completely missing the obvious cause). Thanks! Chris [EMAIL PROTECTED] You rock. That's why Blockbuster's offering you one month of Blockbuster Total Access, No Cost. http://tc.deals.yahoo.com/tc/blockbuster/text5.com ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] What is the standard way to store dates and do operations with dates please?
Near as I can tell, there's no 'standard' way to store dates. SQLite's date functions can deal with dates as floating-point julian numbers, -mm-dd hh:mm:ss strings (with or without the time portion), or Unix time integers. As arguments to SQLite's date/time functions, Unix times usually have to be accompanied by a second argument, 'unixepoch'. In either format, SQLite's date/time functions internally convert -mm-dd... and Unix times into julian dates before evaluating. So, without knowing anything about your specific requirements, the most experienced guys here usually recommend storing dates as julian numbers. It's clearly the most efficient in terms of storage, and effificncy. The downside, of course, is julian and Unix numbers are not human-readable as dates. But, if you need human-readable, -mm-dd hh:mm:ss, with or without the time portion works just as well if you're not tight on storage, and are willing to accept the negligible overhead of the internal conversions when you need to call a date function. Plus, -mm-dd... sorts, and behaves in boolean comparisons appropriately. -Clark - Original Message From: sqlfan <[EMAIL PROTECTED]> To: sqlite-users@sqlite.org Sent: Saturday, April 5, 2008 3:44:37 PM Subject: Re: [sqlite] What is the standard way to store dates and do operations with dates please? is this just your "hack" or the standard way to do this? I don't need it to be floating point, since I'm not interested in "when" during the day. and, to be clear, "julian" is the calendar we all use, right? it's completely 1:1 with the ansi format 2008-04-05 that I mentioned, right? Thank you. Dennis Cote-2 wrote: > > sqlfan wrote: >> I'm very new to sqlite but I notice there is no way to mark a column as >> containing dates... What is the standard way to do operations with dates, >> please, and to store dates? Should I try the format 20080405 and do my >> own >> calculations using my language's standard library? (I'm using Python) or >> is >> there a better way to store dates? Thank you for all your help. I'm >> very >> new to all this. >> > See http://www.sqlite.org/cvstrac/wiki?p=DateAndTimeFunctions for info > on date and time functions. > > I would suggest storing dates as floating point julian day numbers. > > HTH > Dennis Cote > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > > -- View this message in context: http://www.nabble.com/What-is-the-standard-way-to-store-dates-and-do-operations-with-dates-please--tp16514369p16518987.html Sent from the SQLite mailing list archive at Nabble.com. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Unicode searches
Keith Stemmer schrieb: > Yes, I can add a custom collation which works for ASCII chars LOL. > Plain wrong > If you don't understand the problem, just don't reply. > > Plain unreasonable carefulle read ( and understand) this http://sqlite.org/c3ref/create_collation.html and this http://www.wikihow.com/Be-Polite regards, gunnnar ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] What is the standard way to store dates and do operations with dates please?
is this just your "hack" or the standard way to do this? I don't need it to be floating point, since I'm not interested in "when" during the day. and, to be clear, "julian" is the calendar we all use, right? it's completely 1:1 with the ansi format 2008-04-05 that I mentioned, right? Thank you. Dennis Cote-2 wrote: > > sqlfan wrote: >> I'm very new to sqlite but I notice there is no way to mark a column as >> containing dates... What is the standard way to do operations with dates, >> please, and to store dates? Should I try the format 20080405 and do my >> own >> calculations using my language's standard library? (I'm using Python) or >> is >> there a better way to store dates? Thank you for all your help. I'm >> very >> new to all this. >> > See http://www.sqlite.org/cvstrac/wiki?p=DateAndTimeFunctions for info > on date and time functions. > > I would suggest storing dates as floating point julian day numbers. > > HTH > Dennis Cote > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > > -- View this message in context: http://www.nabble.com/What-is-the-standard-way-to-store-dates-and-do-operations-with-dates-please--tp16514369p16518987.html Sent from the SQLite mailing list archive at Nabble.com. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Unicode searches
Yes, I can add a custom collation which works for ASCII chars LOL. If you don't understand the problem, just don't reply. By the way, you can read on the SQLite website that the developer describes my problem as a BUG which is nice to read. At least he doesn't call it a feature. Keith. > > Sort order is highly dependent on locale. You can add custom > > collations to do this. On Sat, Apr 5, 2008 at 11:58 PM, Cory Nelson <[EMAIL PROTECTED]> wrote: > They are one and the same. Look up collations. > > On Sat, Apr 5, 2008 at 2:55 PM, Keith Stemmer > <[EMAIL PROTECTED]> wrote: > > That was not was I was talking about. I was not talking about Sort Order > but > > about Searches. > > Keith > > > > > > > > On Sat, Apr 5, 2008 at 11:42 PM, Cory Nelson <[EMAIL PROTECTED]> wrote: > > > > > Sort order is highly dependent on locale. You can add custom > > > collations to do this. > > > > > > On Sat, Apr 5, 2008 at 10:41 AM, Keith Stemmer > > > <[EMAIL PROTECTED]> wrote: > > > > Hello! > > > > > > > > I found SQLite quite amazing, but I think there is one showstopper > for > > > me. > > > > It seems that searches for Unicode strings are case sensitive and > there > > > is > > > > no (easy) way around that. > > > > Could you please confirm or deny this? > > > > > > > > Your explanation... > > > > > > > > (A bug: SQLite only understands upper/lower case for 7-bit Latin > > > characters. > > > > Hence the LIKE operator is case sensitive for 8-bit iso8859 > characters > > > or > > > > UTF-8 characters. For example, the expression 'a' LIKE 'A' is TRUE > but > > > 'æ' > > > > LIKE 'Æ' is FALSE.). > > > > > > > > seems to destroy all my hopes. > > > > > > > > Thank you very much! > > -- > Cory Nelson > http://www.int64.org > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] problem with undefined reference
>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 / -name sqlite3.h /usr/include/seamonkey-1.1.2/sqlite3/sqlite3.h /usr/include/sqlite3.h bash-3.1# find / -name libsqlite3.so /usr/lib/libsqlite3.so bash-3.1# I try to compile: bash-3.1# gcc -llibsqlite3.so CreaDB.c -o CreaDB CreaDB.c: In function 'main': CreaDB.c:21: warning: incompatible implicit declaration of built-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 /usr/lib/gcc/i486-slackware-linux/4.1.2/../../../../i486-slackware-linux/bin/ld: cannot find -llibsqlite3.so collect2: ld returned 1 exit status bash-3.1# ls CreaDB.c Desktop GNUstep loadlin16c.txt - Inviato da Yahoo! Mail. La casella di posta intelligente. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Unicode searches
They are one and the same. Look up collations. On Sat, Apr 5, 2008 at 2:55 PM, Keith Stemmer <[EMAIL PROTECTED]> wrote: > That was not was I was talking about. I was not talking about Sort Order but > about Searches. > Keith > > > > On Sat, Apr 5, 2008 at 11:42 PM, Cory Nelson <[EMAIL PROTECTED]> wrote: > > > Sort order is highly dependent on locale. You can add custom > > collations to do this. > > > > On Sat, Apr 5, 2008 at 10:41 AM, Keith Stemmer > > <[EMAIL PROTECTED]> wrote: > > > Hello! > > > > > > I found SQLite quite amazing, but I think there is one showstopper for > > me. > > > It seems that searches for Unicode strings are case sensitive and there > > is > > > no (easy) way around that. > > > Could you please confirm or deny this? > > > > > > Your explanation... > > > > > > (A bug: SQLite only understands upper/lower case for 7-bit Latin > > characters. > > > Hence the LIKE operator is case sensitive for 8-bit iso8859 characters > > or > > > UTF-8 characters. For example, the expression 'a' LIKE 'A' is TRUE but > > 'æ' > > > LIKE 'Æ' is FALSE.). > > > > > > seems to destroy all my hopes. > > > > > > Thank you very much! -- Cory Nelson http://www.int64.org ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Unicode searches
Sort order is highly dependent on locale. You can add custom collations to do this. On Sat, Apr 5, 2008 at 10:41 AM, Keith Stemmer <[EMAIL PROTECTED]> wrote: > Hello! > > I found SQLite quite amazing, but I think there is one showstopper for me. > It seems that searches for Unicode strings are case sensitive and there is > no (easy) way around that. > Could you please confirm or deny this? > > Your explanation... > > (A bug: SQLite only understands upper/lower case for 7-bit Latin characters. > Hence the LIKE operator is case sensitive for 8-bit iso8859 characters or > UTF-8 characters. For example, the expression 'a' LIKE 'A' is TRUE but 'æ' > LIKE 'Æ' is FALSE.). > > seems to destroy all my hopes. > > Thank you very much! > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > -- Cory Nelson http://www.int64.org ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] problem with undefined reference
dark0s dark0s wrote: > 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. > You mentioned earlier that you are new to SQLite, but it seems you are new to C programming as well. The following assumes you are working on some variant of UN*X. 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? If you have sqlite-3.5.7.so.gz, you need to use gzip to unpack it, giving you the sqlite-3.5.7.so. Copy it into /usr/local/lib for convenience (cp sqlite-3.5.7 /usr/local/lib/libsqlite.so); I'm assuming you can be root and copy it there. When you compile your application, the command should look like gcc -lsqlite CreaDB.c -o CreaDB If you have the sqlite-amalgamation-3.5.7.tar.gz, you need to unroll the tarball somewhere (tar -zxf sqlite-amalgamation-3.5.7.tar.gz). Then copy sqlite3.{h,c} to your source directory. When you compile your application, the command should look like (as before): gcc sqlite3.c CreaDB.c -o CreaDB To get rid of the warning about strlen(), you need to add #include and the warning about main can be ignored, but if you want to get rid of it, change it to the more standard int main(int argc, char* argv[]) { Might I suggest doing more work on learning how to use your development environment. Good luck. -- Glenn McAllister <[EMAIL PROTECTED]> +1 416 348 1594 SOMA Networks, Inc. http://www.somanetworks.com/ +1 416 977 1414 Asking a writer what he thinks about criticism is like asking a lamppost what it feels about dogs. - John Osborne ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] problem with undefined reference
I type also: bash-3.1# find / -name sqlite3.c bash-3.1# sqlite3.c is not present in my system, and after bash-3.1# gcc CreaDB.c sqlite3.c -o CreaDb gcc: sqlite3.c: No such file or directory CreaDB.c: In function 'main': CreaDB.c:21: warning: incompatible implicit declaration of built-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 or directory CreaDB.c: In function 'main': CreaDB.c:21: warning: incompatible implicit declaration of built-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 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 C program to begin with sqlite, and I posted it below: > > #include > #include > #include > > void main() { > > int rc, i; > sqlite3* db; > sqlite3_stmt* stmt; > char* sql; > const char* tail; > > rc = sqlite3_open("prova.db", ); > if (rc) { > fprintf(stderr, "E' impossibile aprire il file %s\n", sqlite3_errmsg(db)); > sqlite3_close(db); > exit(1); > } > > sql = "create table modulo(id, nome, classe, istanza);"; > rc = sqlite3_prepare(db, sql, strlen(sql), , ); > if (rc != SQLITE_OK) { > fprintf(stderr, "Errore SQL: %s\n", sqlite3_errmsg(db)); > } > > rc = sqlite3_step(stmt); > > while (rc == SQLITE_ROW) { > for (i = 0; i < sqlite3_column_count(stmt); i++) > fprintf(stderr, "'%s' ", sqlite3_column_text(stmt, i)); > fprintf(stderr, "\n"); > rc = sqlite3_step(stmt); > } > >sqlite3_finaqlize(stmt); > sqlite3_close(db); > > } > > So, when I compile above program the result is: > > bash-3.1# gcc CreaDB.c -o CreaDB > CreaDB.c: In function 'main': > CreaDB.c:21: warning: incompatible implicit declaration of built-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 > /tmp/ccs8L4Zw.o: In function `main': > CreaDB.c:(.text+0x1f): undefined reference to `sqlite3_open' > CreaDB.c:(.text+0x37): undefined reference to `sqlite3_errmsg' > CreaDB.c:(.text+0x5e): undefined reference to `sqlite3_close' > CreaDB.c:(.text+0xa4): undefined reference to `sqlite3_prepare' > CreaDB.c:(.text+0xbc): undefined reference to `sqlite3_errmsg' > CreaDB.c:(.text+0xe3): undefined reference to `sqlite3_step' > CreaDB.c:(.text+0x103): undefined reference to `sqlite3_column_text' > CreaDB.c:(.text+0x12d): undefined reference to `sqlite3_column_count' > CreaDB.c:(.text+0x154): undefined reference to `sqlite3_step' > CreaDB.c:(.text+0x16c): undefined reference to `sqlite3_finaqlize' > CreaDB.c:(.text+0x17b): undefined reference to `sqlite3_close' > collect2: ld returned 1 exit status > > > What is the problem? > > Thanks, > savio > >From what I can see you have to pass sqlite3.c to gcc when compiling your >program: gcc CreaDB.c sqlite3.c -o CreaDB Amit - Inviato da Yahoo! Mail. La casella di posta intelligente. - Inviato da Yahoo! Mail. La casella di posta intelligente. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] problem with undefined reference
bash-3.1# gcc CreaDB.c sqlite3.c -o CreaDb gcc: sqlite3.c: No such file or directory CreaDB.c: In function 'main': CreaDB.c:21: warning: incompatible implicit declaration of built-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 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 C program to begin with sqlite, and I posted it below: > > #include > #include > #include > > void main() { > > int rc, i; > sqlite3* db; > sqlite3_stmt* stmt; > char* sql; > const char* tail; > > rc = sqlite3_open("prova.db", ); > if (rc) { > fprintf(stderr, "E' impossibile aprire il file %s\n", sqlite3_errmsg(db)); > sqlite3_close(db); > exit(1); > } > > sql = "create table modulo(id, nome, classe, istanza);"; > rc = sqlite3_prepare(db, sql, strlen(sql), , ); > if (rc != SQLITE_OK) { > fprintf(stderr, "Errore SQL: %s\n", sqlite3_errmsg(db)); > } > > rc = sqlite3_step(stmt); > > while (rc == SQLITE_ROW) { > for (i = 0; i < sqlite3_column_count(stmt); i++) > fprintf(stderr, "'%s' ", sqlite3_column_text(stmt, i)); > fprintf(stderr, "\n"); > rc = sqlite3_step(stmt); > } > > sqlite3_finaqlize(stmt); > sqlite3_close(db); > > } > > So, when I compile above program the result is: > > bash-3.1# gcc CreaDB.c -o CreaDB > CreaDB.c: In function 'main': > CreaDB.c:21: warning: incompatible implicit declaration of built-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 > /tmp/ccs8L4Zw.o: In function `main': > CreaDB.c:(.text+0x1f): undefined reference to `sqlite3_open' > CreaDB.c:(.text+0x37): undefined reference to `sqlite3_errmsg' > CreaDB.c:(.text+0x5e): undefined reference to `sqlite3_close' > CreaDB.c:(.text+0xa4): undefined reference to `sqlite3_prepare' > CreaDB.c:(.text+0xbc): undefined reference to `sqlite3_errmsg' > CreaDB.c:(.text+0xe3): undefined reference to `sqlite3_step' > CreaDB.c:(.text+0x103): undefined reference to `sqlite3_column_text' > CreaDB.c:(.text+0x12d): undefined reference to `sqlite3_column_count' > CreaDB.c:(.text+0x154): undefined reference to `sqlite3_step' > CreaDB.c:(.text+0x16c): undefined reference to `sqlite3_finaqlize' > CreaDB.c:(.text+0x17b): undefined reference to `sqlite3_close' > collect2: ld returned 1 exit status > > > What is the problem? > > Thanks, > savio > >From what I can see you have to pass sqlite3.c to gcc when compiling your >program: gcc CreaDB.c sqlite3.c -o CreaDB Amit - Inviato da Yahoo! Mail. La casella di posta intelligente. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] problem with undefined reference
On Sat, 5 Apr 2008 18:16:47 +0200 (CEST) dark0s dark0s <[EMAIL PROTECTED]> wrote: > Hi all, I am newbye in sqlite programming. > I written a little C program to begin with sqlite, and I posted it below: > > #include > #include > #include > > void main() { > > int rc, i; > sqlite3* db; > sqlite3_stmt* stmt; > char* sql; > const char* tail; > > rc = sqlite3_open("prova.db", ); > if (rc) { > fprintf(stderr, "E' impossibile aprire il file %s\n", sqlite3_errmsg(db)); > sqlite3_close(db); > exit(1); > } > > sql = "create table modulo(id, nome, classe, istanza);"; > rc = sqlite3_prepare(db, sql, strlen(sql), , ); > if (rc != SQLITE_OK) { > fprintf(stderr, "Errore SQL: %s\n", sqlite3_errmsg(db)); > } > > rc = sqlite3_step(stmt); > > while (rc == SQLITE_ROW) { > for (i = 0; i < sqlite3_column_count(stmt); i++) > fprintf(stderr, "'%s' ", sqlite3_column_text(stmt, i)); > fprintf(stderr, "\n"); > rc = sqlite3_step(stmt); > } > > sqlite3_finaqlize(stmt); > sqlite3_close(db); > > } > > So, when I compile above program the result is: > > bash-3.1# gcc CreaDB.c -o CreaDB > CreaDB.c: In function 'main': > CreaDB.c:21: warning: incompatible implicit declaration of built-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 > /tmp/ccs8L4Zw.o: In function `main': > CreaDB.c:(.text+0x1f): undefined reference to `sqlite3_open' > CreaDB.c:(.text+0x37): undefined reference to `sqlite3_errmsg' > CreaDB.c:(.text+0x5e): undefined reference to `sqlite3_close' > CreaDB.c:(.text+0xa4): undefined reference to `sqlite3_prepare' > CreaDB.c:(.text+0xbc): undefined reference to `sqlite3_errmsg' > CreaDB.c:(.text+0xe3): undefined reference to `sqlite3_step' > CreaDB.c:(.text+0x103): undefined reference to `sqlite3_column_text' > CreaDB.c:(.text+0x12d): undefined reference to `sqlite3_column_count' > CreaDB.c:(.text+0x154): undefined reference to `sqlite3_step' > CreaDB.c:(.text+0x16c): undefined reference to `sqlite3_finaqlize' > CreaDB.c:(.text+0x17b): undefined reference to `sqlite3_close' > collect2: ld returned 1 exit status > > > What is the problem? > > Thanks, > savio > >From what I can see you have to pass sqlite3.c to gcc when compiling your >program: gcc CreaDB.c sqlite3.c -o CreaDB Amit ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] problem with undefined reference
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. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] problem with undefined reference
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 http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] Unicode searches
Hello! I found SQLite quite amazing, but I think there is one showstopper for me. It seems that searches for Unicode strings are case sensitive and there is no (easy) way around that. Could you please confirm or deny this? Your explanation... (A bug: SQLite only understands upper/lower case for 7-bit Latin characters. Hence the LIKE operator is case sensitive for 8-bit iso8859 characters or UTF-8 characters. For example, the expression 'a' LIKE 'A' is TRUE but 'æ' LIKE 'Æ' is FALSE.). seems to destroy all my hopes. Thank you very much! ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] problem with undefined reference
dark0s dark0s wrote: > I written a little C program to begin with sqlite, and I posted it below: > > CreaDB.c:(.text+0x1f): undefined reference to `sqlite3_open' > What is the problem? > > You need to link to the sqlite3 library, or add the sqlite3.c amalgamation source file to your compile command. If you have the amalgamation source file you can do this. gcc CreaDB.c sqlite3.c -o CreaDB HTH Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] What is the standard way to store dates and do operations with dates please?
sqlfan wrote: > I'm very new to sqlite but I notice there is no way to mark a column as > containing dates... What is the standard way to do operations with dates, > please, and to store dates? Should I try the format 20080405 and do my own > calculations using my language's standard library? (I'm using Python) or is > there a better way to store dates? Thank you for all your help. I'm very > new to all this. > See http://www.sqlite.org/cvstrac/wiki?p=DateAndTimeFunctions for info on date and time functions. I would suggest storing dates as floating point julian day numbers. HTH Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Adobe AIR Version Issue(?)
tiggyboo wrote: > I created and populated a table via sqlite3 on a Mac OSX machine, and have no > problem working with it from the sqlite3 prompt. However, when I try to > access the sole table (named cftable) in this database via a very simple > Adobe AIR application I'm working on, I get this error: > > Error #3115: SQL Error.', details:'no such table: cftable' > > My question - would this be typical of a version conflict for sqlite, i.e., > is the latest release of AIR perhaps using an embedded sqlite that is not > compatible with what I have (3.1.3) on my machine? I have yet to determine > which version is embedded in AIR. > > It is more likely that you are simply opening a different database, either a different file, a temp file, or an in memory database. In the shell you can enter the command .database at the prompt. The shell will display the path to the file it has open. Ensure this is the same file you are opening in Air. You can check the version of sqlite running in Air by executing the following query: select sqlite_version(); HTH Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] French Translation of SQLite documentation
D. Richard Hipp a écrit : >> Thank you for your answer D. Richard, >> >> So I continue the translation and I will see fossil for future. >> Can you take a ticket for this evolution ? >> >> > > > We can work with you to import your translation whenever > you are ready. > > > D. Richard Hipp > [EMAIL PROTECTED] > > > > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > > Ok, I will tell you when all of the 57 sources pages are translated. Thanks, Yves Maingoy ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] French Translation of SQLite documentation
> > Thank you for your answer D. Richard, > > So I continue the translation and I will see fossil for future. > Can you take a ticket for this evolution ? > We can work with you to import your translation whenever you are ready. D. Richard Hipp [EMAIL PROTECTED] ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] French Translation of SQLite documentation
D. Richard Hipp a écrit : > On Apr 5, 2008, at 10:28 AM, Yves Maingoy wrote: > >> Hello All and Drh, >> >> I am a french user of SQLite and I started to translate it's >> documentation. >> >> I use the tclsh scripts on Windows (with WinTcltk) and I produce >> html pages from *.in sources files found at http://www.sqlite.org/docsrc >> >> The documentation is 20% translated at this time and I temporarily >> put it at this address : http://fr-sqlite.isuisse.com/ >> But, it's not a definitive address : there are advertisings in this >> website (I don't like that) and it's not ambitious enough. >> >> So, I have a proposal from this website : >> http://www.developpez.com/hebergement/ >> to make an fr-SQLite website, free of charge, to help french >> developpers, and where I can put the documentation and maintain it. >> Is there any problem to do this ? >> >> Can I continue to translate the documentation in french ? >> >> > > Of course you can continue. What can the developers do to help? > > Ideally, we would like to make documentation available on the main > SQLite website in multiple languages. French, German, Chinese, > Japanese, > Russian, and so forth. The main problem we see is keeping the > translations up-to-date. Much of the current documentation is generated > automatically from comments in the source code, and it changes, > sometimes dramatically from one release to the next. > > Yves, if you want to put together a French translation of all or > even part of the SQLite documentation, or perhaps even write > separate French-language documentation about SQLite, we will > be willing to post it somewhere on www.sqlite.org. We'll ask that > you store your translation in a fossil repository. (See > http://www.fossil-scm.org/ for details. All current English-language > documentation is in a fossil repostitory hosted at > http://www.sqlite.org/docsrc.) We will ask that each translated > page contain a timestamp of some kind to show when it was > translated and that each page have a pointer back to the > canonical English-language page. I'll try to figure out some way > to have pointers from the English-language pages over to the > translated pages. > > This same offer applies to anybody else who wants translate SQLite > documentation into any other living language. > > D. Richard Hipp > [EMAIL PROTECTED] > > > > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > > Thank you for your answer D. Richard, So I continue the translation and I will see fossil for future. Can you take a ticket for this evolution ? Pending your response, I will modifie my local "wrap_fr.tcl" file like this : in hd_header{} : set outfile [file root [file tail $srcfile]].html append hd(footer) "This page last translated $date.\n" append hd(footer) "See latest http://www.sqlite.org/$outfile\;>English-language pages.\n" append hd(footer) "" in hd_footer {} : ??? never used ??? It's not the real source page (ie. lang_xxx.html) but this gives a pointer back to the official website. Yves Maingoy ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] problem with undefined reference
Hi all, I am newbye in sqlite programming. I written a little C program to begin with sqlite, and I posted it below: #include #include #include void main() { int rc, i; sqlite3* db; sqlite3_stmt* stmt; char* sql; const char* tail; rc = sqlite3_open("prova.db", ); if (rc) { fprintf(stderr, "E' impossibile aprire il file %s\n", sqlite3_errmsg(db)); sqlite3_close(db); exit(1); } sql = "create table modulo(id, nome, classe, istanza);"; rc = sqlite3_prepare(db, sql, strlen(sql), , ); if (rc != SQLITE_OK) { fprintf(stderr, "Errore SQL: %s\n", sqlite3_errmsg(db)); } rc = sqlite3_step(stmt); while (rc == SQLITE_ROW) { for (i = 0; i < sqlite3_column_count(stmt); i++) fprintf(stderr, "'%s' ", sqlite3_column_text(stmt, i)); fprintf(stderr, "\n"); rc = sqlite3_step(stmt); } sqlite3_finaqlize(stmt); sqlite3_close(db); } So, when I compile above program the result is: bash-3.1# gcc CreaDB.c -o CreaDB CreaDB.c: In function 'main': CreaDB.c:21: warning: incompatible implicit declaration of built-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 /tmp/ccs8L4Zw.o: In function `main': CreaDB.c:(.text+0x1f): undefined reference to `sqlite3_open' CreaDB.c:(.text+0x37): undefined reference to `sqlite3_errmsg' CreaDB.c:(.text+0x5e): undefined reference to `sqlite3_close' CreaDB.c:(.text+0xa4): undefined reference to `sqlite3_prepare' CreaDB.c:(.text+0xbc): undefined reference to `sqlite3_errmsg' CreaDB.c:(.text+0xe3): undefined reference to `sqlite3_step' CreaDB.c:(.text+0x103): undefined reference to `sqlite3_column_text' CreaDB.c:(.text+0x12d): undefined reference to `sqlite3_column_count' CreaDB.c:(.text+0x154): undefined reference to `sqlite3_step' CreaDB.c:(.text+0x16c): undefined reference to `sqlite3_finaqlize' CreaDB.c:(.text+0x17b): undefined reference to `sqlite3_close' collect2: ld returned 1 exit status What is the problem? Thanks, savio - Inviato da Yahoo! Mail. La casella di posta intelligente. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] What is the standard way to store dates and do operations with dates please?
I'm very new to sqlite but I notice there is no way to mark a column as containing dates... What is the standard way to do operations with dates, please, and to store dates? Should I try the format 20080405 and do my own calculations using my language's standard library? (I'm using Python) or is there a better way to store dates? Thank you for all your help. I'm very new to all this. -- View this message in context: http://www.nabble.com/What-is-the-standard-way-to-store-dates-and-do-operations-with-dates-please--tp16514369p16514369.html Sent from the SQLite mailing list archive at Nabble.com. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] French Translation of SQLite documentation
On Apr 5, 2008, at 10:28 AM, Yves Maingoy wrote: > Hello All and Drh, > > I am a french user of SQLite and I started to translate it's > documentation. > > I use the tclsh scripts on Windows (with WinTcltk) and I produce > html pages from *.in sources files found at http://www.sqlite.org/docsrc > > The documentation is 20% translated at this time and I temporarily > put it at this address : http://fr-sqlite.isuisse.com/ > But, it's not a definitive address : there are advertisings in this > website (I don't like that) and it's not ambitious enough. > > So, I have a proposal from this website : > http://www.developpez.com/hebergement/ > to make an fr-SQLite website, free of charge, to help french > developpers, and where I can put the documentation and maintain it. > Is there any problem to do this ? > > Can I continue to translate the documentation in french ? > Of course you can continue. What can the developers do to help? Ideally, we would like to make documentation available on the main SQLite website in multiple languages. French, German, Chinese, Japanese, Russian, and so forth. The main problem we see is keeping the translations up-to-date. Much of the current documentation is generated automatically from comments in the source code, and it changes, sometimes dramatically from one release to the next. Yves, if you want to put together a French translation of all or even part of the SQLite documentation, or perhaps even write separate French-language documentation about SQLite, we will be willing to post it somewhere on www.sqlite.org. We'll ask that you store your translation in a fossil repository. (See http://www.fossil-scm.org/ for details. All current English-language documentation is in a fossil repostitory hosted at http://www.sqlite.org/docsrc.) We will ask that each translated page contain a timestamp of some kind to show when it was translated and that each page have a pointer back to the canonical English-language page. I'll try to figure out some way to have pointers from the English-language pages over to the translated pages. This same offer applies to anybody else who wants translate SQLite documentation into any other living language. D. Richard Hipp [EMAIL PROTECTED] ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] French Translation of SQLite documentation
Hello All and Drh, I am a french user of SQLite and I started to translate it's documentation. I use the tclsh scripts on Windows (with WinTcltk) and I produce html pages from *.in sources files found at http://www.sqlite.org/docsrc The documentation is 20% translated at this time and I temporarily put it at this address : http://fr-sqlite.isuisse.com/ But, it's not a definitive address : there are advertisings in this website (I don't like that) and it's not ambitious enough. So, I have a proposal from this website : http://www.developpez.com/hebergement/ to make an fr-SQLite website, free of charge, to help french developpers, and where I can put the documentation and maintain it. Is there any problem to do this ? Can I continue to translate the documentation in french ? I just want to help french users and provide a french documentation, how can I do that ? Regards, Yves Maingoy France ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] VACUUM'ing
Hi, If this is a production system? Then I'd do the following: 1. Make a backup. 2. Run Vacuum manually. I would automate this as part of a periodic maintenance schedule, (weekly/bi-weekly etc..) This is given then number of bugs and issues with DB corruption when running vacuum. The developers of sqlite have gone to great lengths to resolve the vacuum corruption issues, but I tend to error on the side of safety for production data. HTH, Ken Bambero <[EMAIL PROTECTED]> wrote: Hi, I have a small problem with database size. I wrote a http session class to use with sqlite and after few months databse is huge. I read some about VACUUM but now I don't realy know which solution is better. Set the auto_vacuum pragma command before creating session table or calling VACUUM command after remove rows from session table. Which solution is better and faster in this case ? Regards, Bambero -- Bambero ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] Adobe AIR Version Issue(?)
I created and populated a table via sqlite3 on a Mac OSX machine, and have no problem working with it from the sqlite3 prompt. However, when I try to access the sole table (named cftable) in this database via a very simple Adobe AIR application I'm working on, I get this error: Error #3115: SQL Error.', details:'no such table: cftable' My question - would this be typical of a version conflict for sqlite, i.e., is the latest release of AIR perhaps using an embedded sqlite that is not compatible with what I have (3.1.3) on my machine? I have yet to determine which version is embedded in AIR. Thanks, Al -- View this message in context: http://www.nabble.com/Adobe-AIR-Version-Issue%28-%29-tp16512203p16512203.html Sent from the SQLite mailing list archive at Nabble.com. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] ticket 3007
In general I believe that is a good idea give to the developer the maximun control of what happen under the hood. Greetings Adolfo -Original Message- From: Ken [mailto:[EMAIL PROTECTED] Sent: Friday, April 4, 2008 08:15 PM To: sqlite-users@sqlite.org Subject: [sqlite] ticket 3007 Any thoughts on ticket 3007, to disable journalling by passing an omit journal flag to the sqlite3_open_v2 interface? This would have the I/O load for writes and probably double the througput.http://www.sqlite.org/cvstrac/tktview?tn=3007Thanks,Ken___sqlite-users mailing [EMAIL PROTECTED]://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] Update Trigger
Dennis Wrote: >If you want to update the AlbumName field, you must do that with an >update statement running on the Album table, not the Music table, since >that is where the AlbumName field is stored. You haven't said what you >want to update the AlbumName or ArtistName to. You probably have a >condition, that you also haven't described, that selects which records >in the table to update. Generally it will look something like this. k.say there are 4 records in the MUSIC table This table has only the Album_id and not the Albumname .But If I want to update all the AlbumName for all the records in MUSIC table to only one AlbumName say 'Album1' then the rest of the AlbmName has to be deleted in the ALBUM Table and Album1 Id should be provided as Album_Id for all the records in the MUSIC table. I think then I have to delete all the records in the ALBUM Table and insert one new record with the new AlbumName.Then I have to update Albim_Id for all the records in the MUSIC table.Am I right or is there any other way. >If this isn't what you are looking for, you will have to describe your >problem in more detail (i.e. what you are trying to do, an example of >before and after data, etc.) before anyone can provide more assistance. >Original Table Before Update: "CREATE TABLE ARTIST (ArtistId INTEGER PRIMARY KEY NOT NULL,ArtistName TEXT NOT NULL COLLATE NOCASE ,YomiArtistName TEXT NOT NULL,UNIQUE(ArtistName));" ArtistId ArtistName YomiArtistName 10 bbb BBB 11 xxx XXX 12 aaa AAA "CREATE TABLE MUSIC(Id INTEGER PRIMARY KEY NOT NULL,Track TEXT NOT NULL,YomiTrack TEXT NOT NULL,URL TEXT NOT NULL,Album_Id INTEGER,Artist_Id INTEGER);" Id Track YomiTrack URLAlbum_Id Artist_Id 1 trak1 TRAK1 c:/trak1 22 10 2 songSONG c:/song 21 11 3 abc ABC c:/abc23 12 Delete * from ARTIST. Insert into ARTIST (ArtistName,YomiArtistName) values ('Album1'); Update MUSIC SET Album_Id = ( select Albumid from ALBUM where ArtistName ='Album1'); Modified Table After Update: "CREATE TABLE ARTIST (ArtistId INTEGER PRIMARY KEY NOT NULL,ArtistName TEXT NOT NULL COLLATE NOCASE ,YomiArtistName TEXT NOT NULL,UNIQUE(ArtistName));" ArtistId ArtistName YomiArtistName 1 Album1 ALBUM1 "CREATE TABLE MUSIC(Id INTEGER PRIMARY KEY NOT NULL,Track TEXT NOT NULL,YomiTrack TEXT NOT NULL,URL TEXT NOT NULL,Album_Id INTEGER,Artist_Id INTEGER);" Id Track YomiTrack URLAlbum_Id Artist_Id 1 trak1 TRAK1 c:/trak1 110 2 songSONG c:/song 111 3 abc ABC c:/abc112 Similarly I will change the artist name of all the records also. Thanks & Regards, Mahalakshmi ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users