Re: [sqlite] Re: INSERT OR REPLACE without new rowid
On 24/04/07, Igor Tandetnik [EMAIL PROTECTED] wrote: Trey Mack [EMAIL PROTECTED] wrote: I'd like to perform an update to a row if it exists (uniquely identified by 3 text columns), otherwise insert a new row with the right data. INSERT OR REPLACE looks good, but it generates a new primary key each time there is a conflict. If the row exists, I need to keep the original primary key (rowid). Any way to do this short of SELECT.. if (exists) UPDATE else INSERT ? You can do UPDATE ... WHERE keyfield='xxx'; then use sqlite3_changes to see whether any update has in fact taken place, and run INSERT if not. Igor Tandetnik - To unsubscribe, send email to [EMAIL PROTECTED] - This is a good solution! Thanks for your idea man! ;) -- Cesar Rodas http://www.cesarodas.com/ Mobile Phone: 595 961 974165 Phone: 595 21 645590 [EMAIL PROTECTED] [EMAIL PROTECTED]
Re: [sqlite] Powered by SQLite image?
OK We will wait for it ;)... but i think you should put into your website and send here the link, because i think (i am not sure) you could not send attach email here. On 04/05/07, Alberto Simões [EMAIL PROTECTED] wrote: On 5/4/07, Griggs, Donald [EMAIL PROTECTED] wrote: Regarding: Is there any image/logo with powered by SQLite? You know, people with web services (not webservices) that rely on SQLite might like to say that to others :) Well, Alberto, there *was* one, but it was so very tiny, lightweight, and efficient that few could actually see it. ;-) Seriously though, I believe the nice logo at the upper left on page: http://www.sqlite.org/index.html can be used, If nobody have one, I'll try to put one up tomorrow :) Cheers Thanks -- Alberto Simões - To unsubscribe, send email to [EMAIL PROTECTED] - -- Cesar Rodas http://www.cesarodas.com/ http://cesars.users.phpclasses.org/winners.html I won ;) Mobile Phone: 595 961 974165 Phone: 595 21 645590 [EMAIL PROTECTED] [EMAIL PROTECTED]
Re: [sqlite] Powered by SQLite image?
Looks great... and this image is public domain? On 04/05/07, Alberto Simões [EMAIL PROTECTED] wrote: If nobody have one, I'll try to put one up tomorrow :) Ok, I had some time today. What do you think of the one shown in: http://dicionario-aberto.net/bin/dic.pl Cheers Alberto -- Alberto Simões - To unsubscribe, send email to [EMAIL PROTECTED] - -- Cesar Rodas http://www.cesarodas.com/ http://cesars.users.phpclasses.org/winners.html I won ;) Mobile Phone: 595 961 974165 Phone: 595 21 645590 [EMAIL PROTECTED] [EMAIL PROTECTED]
Re: [sqlite] Powered by SQLite image?
Will u please send me to this email? thank you On 04/05/07, Alberto Simões [EMAIL PROTECTED] wrote: On 5/4/07, Cesar Rodas [EMAIL PROTECTED] wrote: Looks great... and this image is public domain? Sure. Be free to use it. Also, I have the xcf file. So if anybody knows how to tweak Gimp, I'll be pleased to send it. Cheers Alberto On 04/05/07, Alberto Simões [EMAIL PROTECTED] wrote: If nobody have one, I'll try to put one up tomorrow :) Ok, I had some time today. What do you think of the one shown in: http://dicionario-aberto.net/bin/dic.pl Cheers Alberto -- Alberto Simões - To unsubscribe, send email to [EMAIL PROTECTED] - -- Cesar Rodas http://www.cesarodas.com/ http://cesars.users.phpclasses.org/winners.html I won ;) Mobile Phone: 595 961 974165 Phone: 595 21 645590 [EMAIL PROTECTED] [EMAIL PROTECTED] -- Alberto Simões - To unsubscribe, send email to [EMAIL PROTECTED] - -- Cesar Rodas http://www.cesarodas.com/ http://cesars.users.phpclasses.org/winners.html I won ;) Mobile Phone: 595 961 974165 Phone: 595 21 645590 [EMAIL PROTECTED] [EMAIL PROTECTED]
[sqlite] SQLite wrapper
Hello to every one! I want to ask if there is a Ruby and/or Ruby on Rails SQLite wrapper... Thanks to all. -- Cesar Rodas http://www.cesarodas.com/ http://cesars.users.phpclasses.org/winners.html - I won!!! ;) Mobile Phone: 595 961 974165 Phone: 595 21 645590 [EMAIL PROTECTED] [EMAIL PROTECTED]
Re: [sqlite] Journal file question
I think is imposible... what you need to do is to create a dbname.db-journalform a dbname.db and set permission to truncate, write, but not for delete.. that is what i suggest, but i didnt try it... On 18/04/07, DragonK [EMAIL PROTECTED] wrote: Hi, I'm having the following problem: a sqlite database file is on an NTFS filesystem, in a directory with no permissions to create new files, but only to modify the original database. By using filemon i've noticed some access denied errors when sqlite attempted to create the journal files. I've created a sepparate test case and (by using filemon again) i've noticed that indeed, sqlite uses the journal file, even outside transactions (an insert sql was executed). My question is how can I stop this behaviour (creating/deleting the journal) so that sqlite will work properly under the scenario described above (when it can't create the journal)? PS: Yes, I know, I'm still google-ing, but I'm not having much luck, that's why I'm posting here.. Thanks! -- ...it's only a matter of time... -- Cesar Rodas http://www.cesarodas.com/ Mobile Phone: 595 961 974165 Phone: 595 21 645590 [EMAIL PROTECTED] [EMAIL PROTECTED]
[sqlite] SQLite join-mechanisms question
Hello. I have a question about SQLite join-mechanisms. Let me explain with an example. I have the follow table. CREATE TABLE a( word_id INTEGER, doc_id INTEGER ); CREATE INDEX a_index1 ON a( doc_id ASC ); CREATE INDEX a_index ON a ( word_id DESC ); And how can SQLite do an optimized join of the follow query SELECT a.doc_id FROM a, a as a1, a as a2 WHERE a.doc_id = a1.doc_id and a1.doc_id = a2.doc_id and a.word_id = 1 and a1.word_id = 2 and a2.word_id = 4 LIMIT 0,20 What the example do is find the doc_id that has word_id 1,2 and 4. And suppose that there is: - 4 docs with word_id 1 - 5 docs with word_id 2 - 353500 docs with word_id 4 What i am searching is a optimized way to join, i mean, the algorithm. And I think SQLite has a great performance with joins. Thank to all. -- Cesar Rodas http://www.cesarodas.com/ Mobile Phone: 595 961 974165 Phone: 595 21 645590 [EMAIL PROTECTED] [EMAIL PROTECTED]
Re: [sqlite] SQLite join-mechanisms question
I want to know SQLite join algorithm On 12/04/07, P Kishor [EMAIL PROTECTED] wrote: On 4/12/07, Cesar Rodas [EMAIL PROTECTED] wrote: Hello. I have a question about SQLite join-mechanisms. Let me explain with an example. I have the follow table. CREATE TABLE a( word_id INTEGER, doc_id INTEGER ); CREATE INDEX a_index1 ON a( doc_id ASC ); CREATE INDEX a_index ON a ( word_id DESC ); And how can SQLite do an optimized join of the follow query SELECT a.doc_id FROM a, a as a1, a as a2 WHERE a.doc_id = a1.doc_id and a1.doc_id = a2.doc_id and a.word_id = 1 and a1.word_id = 2 and a2.word_id = 4 LIMIT 0,20 Cesar, Am I flaking out or are you just making things more complicated for yourself than they need be -- What the example do is find the doc_id that has word_id 1,2 and 4. And suppose that there is: This Query is not equal to my query. Would a simple statement like the following work? SELECT doc_id FROM a WHERE word_id IN (1, 2, 4) - 4 docs with word_id 1 - 5 docs with word_id 2 - 353500 docs with word_id 4 -- Puneet Kishor http://punkish.eidesis.org/ Nelson Inst. for Env. Studies, UW-Madison http://www.nelson.wisc.edu/ Open Source Geospatial Foundation http://www.osgeo.org/education/ - collaborate, communicate, compete = - To unsubscribe, send email to [EMAIL PROTECTED] - -- Cesar Rodas http://www.cesarodas.com/ Mobile Phone: 595 961 974165 Phone: 595 21 645590 [EMAIL PROTECTED] [EMAIL PROTECTED]
Re: [sqlite] SQLite join-mechanisms question
On 12/04/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Cesar Rodas [EMAIL PROTECTED] wrote: Hello. I have a question about SQLite join-mechanisms. Let me explain with an example. I have the follow table. CREATE TABLE a( word_id INTEGER, doc_id INTEGER ); CREATE INDEX a_index1 ON a( doc_id ASC ); CREATE INDEX a_index ON a ( word_id DESC ); And how can SQLite do an optimized join of the follow query SELECT a.doc_id FROM a, a as a1, a as a2 WHERE a.doc_id = a1.doc_id and a1.doc_id = a2.doc_id and a.word_id = 1 and a1.word_id = 2 and a2.word_id = 4 LIMIT 0,20 My (untested) guess it that you will get better performance if you do this: DROP INDEX a_index1; DROP INDEX a_index; CREATE INDEX a_index2 ON a(doc_id, word_id); I will also guess that ANALYZE will help in this case. -- D. Richard Hipp [EMAIL PROTECTED] - To unsubscribe, send email to [EMAIL PROTECTED] - Thanks for the answer mister Hipp, but I am searching an SQL help. I'd like to know how is the SQLite join algorithm or where i could find it (in what .c file). Thank for the help! ;) -- Cesar Rodas http://www.cesarodas.com/ Mobile Phone: 595 961 974165 Phone: 595 21 645590 [EMAIL PROTECTED] [EMAIL PROTECTED]
Re: [sqlite] SQLite join-mechanisms question
Thank very very much That is the information that i was searching for! ;) On 12/04/07, Dennis Cote [EMAIL PROTECTED] wrote: Cesar Rodas wrote: Thanks for the answer mister Hipp, but I am searching an SQL help. I'd like to know how is the SQLite join algorithm or where i could find it (in what .c file). Thank for the help! ;) Cesar, You should check out the slide show at http://www.sqlite.org/php2004/page-001.html The discussion of indexes starts about slide 40 and joins are on slide 57. HTH Dennis Cote - To unsubscribe, send email to [EMAIL PROTECTED] - -- Cesar Rodas http://www.cesarodas.com/ Mobile Phone: 595 961 974165 Phone: 595 21 645590 [EMAIL PROTECTED] [EMAIL PROTECTED]
Re: [sqlite] SQL and SQLite pronounciation?
S. Q. Lite... that is my pronunciation and as I read in a book that is its pronunciation On 04/04/07, Alberto Simões [EMAIL PROTECTED] wrote: On 4/4/07, Joel Cochran [EMAIL PROTECTED] wrote: I prefer the ess cue ell version. And I can never remmeber that there is only one el, so I end up saying ess cue ell light even though I know its wrong. Join the club, Joel. I do the same, myself. With the only difference that I pronounce the 'S' 'Q' and 'L' letters in Portuguese. Cheers -- Alberto Simões - To unsubscribe, send email to [EMAIL PROTECTED] - -- Cesar Rodas http://www.cesarodas.com/ Mobile Phone: 595 961 974165 Phone: 595 21 645590 [EMAIL PROTECTED] [EMAIL PROTECTED]
Re: [sqlite] sqlite and generate dynamic html
PHP + SQLite... is the easiest way to develop something... On 03/04/07, John Stanton [EMAIL PROTECTED] wrote: What does the HTML have to do? Vivek Rajan wrote: Hello SQLite Community- For a personal project, I need to dynamically create HTML pages from an on-disk SQLite database. I don't need cross-network capability, I just need the ability to query and dynamically generate HTML from an on-disk SQLite database on a localhost (stand-alone unix machine). I am using PERL as the API for accessing/querying SQLite. Has someone done something like this? Could you please post any code snippets, suggestions and/or pointers for how to do this? Thanks in advance. Rajan - To unsubscribe, send email to [EMAIL PROTECTED] - -- Cesar Rodas http://www.cesarodas.com/ Mobile Phone: 595 961 974165 Phone: 595 21 645590 [EMAIL PROTECTED] [EMAIL PROTECTED]
Re: [sqlite] sqlite and generate dynamic html
Take a look here http://www.php.net/sqlite On 03/04/07, Vivek Rajan [EMAIL PROTECTED] wrote: I need to generate dynamic HTML from contents in the SQLite database. Display some text/tables and related. Upon clicking on the web-page, the web-page can generate another query and display subsequent queries as HTML on the web. On 4/3/07, John Stanton [EMAIL PROTECTED] wrote: What does the HTML have to do? Vivek Rajan wrote: Hello SQLite Community- For a personal project, I need to dynamically create HTML pages from an on-disk SQLite database. I don't need cross-network capability, I just need the ability to query and dynamically generate HTML from an on-disk SQLite database on a localhost (stand-alone unix machine). I am using PERL as the API for accessing/querying SQLite. Has someone done something like this? Could you please post any code snippets, suggestions and/or pointers for how to do this? Thanks in advance. Rajan - To unsubscribe, send email to [EMAIL PROTECTED] - -- Vivek Rajan (503) 646-3985 -- Cesar Rodas http://www.cesarodas.com/ Mobile Phone: 595 961 974165 Phone: 595 21 645590 [EMAIL PROTECTED] [EMAIL PROTECTED]
Re: [sqlite] Version 3.3.14
here http://www.sqlite.org/download.html i only could see the 3.13.. what is wrong with that? On 02/04/07, Clark Christensen [EMAIL PROTECTED] wrote: Did you use configure; make to get this error? Yes. I used the configure script, and make, as you describe. -Clark - Original Message From: [EMAIL PROTECTED] [EMAIL PROTECTED] To: sqlite-users@sqlite.org Sent: Monday, April 2, 2007 1:47:26 PM Subject: Re: [sqlite] Version 3.3.14 Clark Christensen [EMAIL PROTECTED] wrote: I'm seeing an error in make test for 3.3.14: /tmp/ccDdRRCh.o: In function `Sqlitetest1_Init': /home/cchriste/sqlite-3.3.14/src/test1.c:4321: undefined reference to `sqlite3_xferopt_count' collect2: ld returned 1 exit status make: *** [testfixture] Error 1 $ Red Hat Linux 7.2 (2.4.7.10); gcc 3.0.2 tcl 8.4.12 SQLite v3.3.13 and earlier tested OK for me. Any ideas? Something too old in my setup? The sqlite3_xferopt_count global variable only exists if you compile with -DSQLITE_TEST=1. It appears that the insert.c module was not so compiled. Did you use configure; make to get this error? -- D. Richard Hipp [EMAIL PROTECTED] - To unsubscribe, send email to [EMAIL PROTECTED] - - To unsubscribe, send email to [EMAIL PROTECTED] - -- Cesar Rodas http://www.cesarodas.com/ Mobile Phone: 595 961 974165 Phone: 595 21 645590 [EMAIL PROTECTED] [EMAIL PROTECTED]
Re: [sqlite] Version 3.3.14
sorry! was only my proxy cache.. On 02/04/07, Cesar Rodas [EMAIL PROTECTED] wrote: here http://www.sqlite.org/download.html i only could see the 3.13.. what is wrong with that? On 02/04/07, Clark Christensen [EMAIL PROTECTED] wrote: Did you use configure; make to get this error? Yes. I used the configure script, and make, as you describe. -Clark - Original Message From: [EMAIL PROTECTED] [EMAIL PROTECTED] To: sqlite-users@sqlite.org Sent: Monday, April 2, 2007 1:47:26 PM Subject: Re: [sqlite] Version 3.3.14 Clark Christensen [EMAIL PROTECTED] wrote: I'm seeing an error in make test for 3.3.14: /tmp/ccDdRRCh.o: In function `Sqlitetest1_Init': /home/cchriste/sqlite-3.3.14/src/test1.c:4321: undefined reference to `sqlite3_xferopt_count' collect2: ld returned 1 exit status make: *** [testfixture] Error 1 $ Red Hat Linux 7.2 (2.4.7.10); gcc 3.0.2 tcl 8.4.12 SQLite v3.3.13 and earlier tested OK for me. Any ideas? Something too old in my setup? The sqlite3_xferopt_count global variable only exists if you compile with -DSQLITE_TEST=1. It appears that the insert.c module was not so compiled. Did you use configure; make to get this error? -- D. Richard Hipp [EMAIL PROTECTED] - To unsubscribe, send email to [EMAIL PROTECTED] - - To unsubscribe, send email to [EMAIL PROTECTED] - -- Cesar Rodas http://www.cesarodas.com/ Mobile Phone: 595 961 974165 Phone: 595 21 645590 [EMAIL PROTECTED] [EMAIL PROTECTED] -- Cesar Rodas http://www.cesarodas.com/ Mobile Phone: 595 961 974165 Phone: 595 21 645590 [EMAIL PROTECTED] [EMAIL PROTECTED]
Re: [sqlite] Using the Sqlite Btree Backend directly
On 30/03/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: I'm looking at using Sqlite as a storage backend for a program. Using SQL is a little bit overkill why bother with SQLite then? Use the right tool for the job -- use BerkeleyDB. Size is a constraint for me. I see that SQLite can be around 170KB where BerkeleyDB is around 500K. I also see that the SQL statements can be converted to byte code. Is this byte code more efficient that the SQL statement in code size? I'm looking at embedding a DB of some type into a Single Board Computer with no OS. There is a proprietary version of SQLite (call the SQLite Stored Statement Extension of SSE) that can be as small as about 50K, especially if all you want is key/value pairs. SSE omits the SQL parser on the embedded device. You store the SQL statements that you want to run in a table in your database file. Then on a development machine, you run a special command that precompiles those SQL statements into bytecode and stores the bytecode back in the database in place of the original SQL. Then you transfer the database to the embedded device. On the embedded device, you specify precompiled SQL statements by number, loading them out of the database as sqlite3_stmt objects. Then you bind host parameters and run sqlite3_step() and sqlite3_reset() or sqlite3_finalize() just like you normally would. SSE is currently used on smart cards where memory is scarce and battery power even scarcer. But it is proprietary, not free like standard SQLite. On the other hand, it is much, much less expensive than BDB. Sound very good! The bytecode is actually larger than the original SQL statements, in most cases. How much larger depends on the statement. SQL like I will work the weekend if i have time to do something like this. A SQLite compiler.. and a DB-Manager just with the bytecode virtual machine. Is that usefull? SELECT * FROM table1 can generate either small or large amounts of byte code depending, for example, on how many columns the * expands into. Please contact me off-list if you want more information. -- D. Richard Hipp [EMAIL PROTECTED] - To unsubscribe, send email to [EMAIL PROTECTED] - -- Cesar Rodas http://www.cesarodas.com/ Mobile Phone: 595 961 974165 Phone: 595 21 645590 [EMAIL PROTECTED] [EMAIL PROTECTED]
Re: [sqlite] Using the Sqlite Btree Backend directly
On 31/03/07, Cesar Rodas [EMAIL PROTECTED] wrote: On 30/03/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: I'm looking at using Sqlite as a storage backend for a program. Using SQL is a little bit overkill why bother with SQLite then? Use the right tool for the job -- use BerkeleyDB. Size is a constraint for me. I see that SQLite can be around 170KB where BerkeleyDB is around 500K. I also see that the SQL statements can be converted to byte code. Is this byte code more efficient that the SQL statement in code size? I'm looking at embedding a DB of some type into a Single Board Computer with no OS. There is a proprietary version of SQLite (call the SQLite Stored Statement Extension of SSE) that can be as small as about 50K, especially if all you want is key/value pairs. SSE omits the SQL parser on the embedded device. You store the SQL statements that you want to run in a table in your database file. Then on a development machine, you run a special command that precompiles those SQL statements into bytecode and stores the bytecode back in the database in place of the original SQL. Then you transfer the database to the embedded device. On the embedded device, you specify precompiled SQL statements by number, loading them out of the database as sqlite3_stmt objects. Then you bind host parameters and run sqlite3_step() and sqlite3_reset() or sqlite3_finalize() just like you normally would. SSE is currently used on smart cards where memory is scarce and battery power even scarcer. But it is proprietary, not free like standard SQLite. On the other hand, it is much, much less expensive than BDB. Sound very good! The bytecode is actually larger than the original SQL statements, in most cases. How much larger depends on the statement. SQL like I will work the weekend if i have time to do something like this. A SQLite compiler.. and a DB-Manager just with the bytecode virtual machine. Is that usefull? SELECT * FROM table1 can generate either small or large amounts of byte code depending, for example, on how many columns the * expands into. Please contact me off-list if you want more information. -- D. Richard Hipp [EMAIL PROTECTED] - To unsubscribe, send email to [EMAIL PROTECTED] - -- Cesar Rodas http://www.cesarodas.com/ Mobile Phone: 595 961 974165 Phone: 595 21 645590 [EMAIL PROTECTED] [EMAIL PROTECTED] And the source will be public domain as SQLite -- Cesar Rodas http://www.cesarodas.com/ Mobile Phone: 595 961 974165 Phone: 595 21 645590 [EMAIL PROTECTED] [EMAIL PROTECTED]
Re: [sqlite] invalid command name sqlite3
what OS are you using? On 30/03/07, Reber Douglas-ra7758 [EMAIL PROTECTED] wrote: Noah, Thanks for the input. I tried changing the case on both lines first with the load command and then with the db access line and both times I get the same error. Any other suggestions? Thanks, Doug -Original Message- From: Noah Hart [mailto:[EMAIL PROTECTED] Sent: Friday, March 30, 2007 11:19 AM To: sqlite-users@sqlite.org Subject: RE: [sqlite] invalid command name sqlite3 Is your operating system case sensitive? Try sqlite3, rather than Sqlite3 Regards, Noah -Original Message- From: Reber Douglas-ra7758 [mailto:[EMAIL PROTECTED] Sent: Friday, March 30, 2007 9:08 AM To: sqlite-users@sqlite.org Subject: [sqlite] invalid command name sqlite3 I continue to get an invalid command name sqlite3 with the following code: Load /_TOOLS/plat/lib/tclsqlite-3.3.13.so Sqlite3 Sqlite3 db Gem.db The source object exists correctly but it appears the API is not working. Your help is greatly appreciated. Doug Reber CONFIDENTIALITY NOTICE: This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose, or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. - To unsubscribe, send email to [EMAIL PROTECTED] - - To unsubscribe, send email to [EMAIL PROTECTED] - -- Cesar Rodas http://www.cesarodas.com/ Mobile Phone: 595 961 974165 Phone: 595 21 645590 [EMAIL PROTECTED] [EMAIL PROTECTED]
Re: [sqlite] invalid command name sqlite3
Can you do the next commands into your bash or you have errors?: cd /_TOOLS/plat/lib/ ls tclsqlite-3.3.13.so On 30/03/07, Reber Douglas-ra7758 [EMAIL PROTECTED] wrote: I have tried it on sun sparc and on linux with the same identical results. Thanks, Doug -Original Message- From: Cesar Rodas [mailto:[EMAIL PROTECTED] Sent: Friday, March 30, 2007 12:31 PM To: sqlite-users@sqlite.org Subject: Re: [sqlite] invalid command name sqlite3 what OS are you using? On 30/03/07, Reber Douglas-ra7758 [EMAIL PROTECTED] wrote: Noah, Thanks for the input. I tried changing the case on both lines first with the load command and then with the db access line and both times I get the same error. Any other suggestions? Thanks, Doug -Original Message- From: Noah Hart [mailto:[EMAIL PROTECTED] Sent: Friday, March 30, 2007 11:19 AM To: sqlite-users@sqlite.org Subject: RE: [sqlite] invalid command name sqlite3 Is your operating system case sensitive? Try sqlite3, rather than Sqlite3 Regards, Noah -Original Message- From: Reber Douglas-ra7758 [mailto:[EMAIL PROTECTED] Sent: Friday, March 30, 2007 9:08 AM To: sqlite-users@sqlite.org Subject: [sqlite] invalid command name sqlite3 I continue to get an invalid command name sqlite3 with the following code: Load /_TOOLS/plat/lib/tclsqlite-3.3.13.so Sqlite3 Sqlite3 db Gem.db The source object exists correctly but it appears the API is not working. Your help is greatly appreciated. Doug Reber CONFIDENTIALITY NOTICE: This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose, or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. - To unsubscribe, send email to [EMAIL PROTECTED] - - To unsubscribe, send email to [EMAIL PROTECTED] - -- Cesar Rodas http://www.cesarodas.com/ Mobile Phone: 595 961 974165 Phone: 595 21 645590 [EMAIL PROTECTED] [EMAIL PROTECTED] - To unsubscribe, send email to [EMAIL PROTECTED] - -- Cesar Rodas http://www.cesarodas.com/ Mobile Phone: 595 961 974165 Phone: 595 21 645590 [EMAIL PROTECTED] [EMAIL PROTECTED] - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] multiple request handling
YEah... but every thread need to have its connection. Is not a good idea to have a global connection and use in deferents threads. On 30/03/07, Pavan [EMAIL PROTECTED] wrote: Hi, Does SQLite handle multiple request handling ? Thanks, Pavan. -- ' Always finish stronger than you start * -- Cesar Rodas http://www.cesarodas.com/ Mobile Phone: 595 961 974165 Phone: 595 21 645590 [EMAIL PROTECTED] [EMAIL PROTECTED] - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] SQLite installation problems
you need to open the file tclsqlite.c and write the follow sentence in the top!.. save and execute ./configure make make install #define NO_TCL and that should work- Show quoted text - On 23/03/07, Brian McCann [EMAIL PROTECTED]//[EMAIL PROTECTED]/ wrote: Hi, I'm trying to install SQLite in order to use Trac with our SVN repositories. Where running RedHat 4 Ent. I downloaded the source code file sqlite-3.3.13.tgz and followed the README on how to compile but ran into the problem that the header file tcl.h could not be found, even though I have the rpm tcl-8.4.7-2 installed it is missing the tcl-devel package so the compile fails when I run make. I see there is another way to get SQLite installed by using the precompiled binaries for linux. but where do I put these files tclsqlite-3.3.13.so, fts2-3_3_13.so and sqlite3_analyzer-3.3.13.bin on my system? Also is there an rpm package for RH4 enterprise? Thanks, Brian -- Cesar Rodas http://www.cesarodas.com/ Mobile Phone: 595 961 974165 Phone: 595 21 645590 [EMAIL PROTECTED] //[EMAIL PROTECTED]/ [EMAIL PROTECTED] //[EMAIL PROTECTED]/
Re: [sqlite] SQLite installation problems
you need to open the file tclsqlite.c and write the follow sentence in the top!.. save and execute ./configure make make install #define NO_TCL and that should work On 23/03/07, Brian McCann [EMAIL PROTECTED] wrote: Hi, I'm trying to install SQLite in order to use Trac with our SVN repositories. Where running RedHat 4 Ent. I downloaded the source code file sqlite-3.3.13.tgz and followed the README on how to compile but ran into the problem that the header file tcl.h could not be found, even though I have the rpm tcl-8.4.7-2 installed it is missing the tcl-devel package so the compile fails when I run make. I see there is another way to get SQLite installed by using the precompiled binaries for linux. but where do I put these files tclsqlite-3.3.13.so, fts2-3_3_13.so and sqlite3_analyzer-3.3.13.bin on my system? Also is there an rpm package for RH4 enterprise? Thanks, Brian -- Cesar Rodas http://www.cesarodas.com/ Mobile Phone: 595 961 974165 Phone: 595 21 645590 [EMAIL PROTECTED] [EMAIL PROTECTED]
Re: [sqlite] Search engines and the Sqlite.Org website
I think you should disalow MSN bot... nobody use that... if there is top in google when you search Embedded SQL database, what else could sqlite needs?... MSN is not used (at least here in south America and the rest of the world) Another question... your robots.txt is this User-agent: * Disallow: /cvstrac/attach_add Disallow: /cvstrac/attach_get Disallow: /cvstrac/chngedit Disallow: /cvstrac/chngview Disallow: /cvstrac/dir Disallow: /cvstrac/filediff Disallow: /cvstrac/getfile Disallow: /cvstrac/msedit Disallow: /cvstrac/msnew Disallow: /cvstrac/rlog Disallow: /cvstrac/rptedit Disallow: /cvstrac/rptnew Disallow: /cvstrac/rptsql Disallow: /cvstrac/timeline Disallow: /cvstrac/tktedit Disallow: /cvstrac/tktview Disallow: /cvstrac/wikiedit Disallow: /cvstrac/honeypot Disallow: /cvstrac/wiki/attach_get Disallow: /contrib/download wont be better if you change for this???: User-agent: * Disallow: /cvstrac/attach_add* Disallow: /cvstrac/attach_get* Disallow: /cvstrac/chngedit* Disallow: /cvstrac/chngview* Disallow: /cvstrac/dir* Disallow: /cvstrac/filediff* Disallow: /cvstrac/getfile* Disallow: /cvstrac/msedit* Disallow: /cvstrac/msnew* Disallow: /cvstrac/rlog* Disallow: /cvstrac/rptedit* Disallow: /cvstrac/rptnew* Disallow: /cvstrac/rptsql* Disallow: /cvstrac/timeline* Disallow: /cvstrac/tktedit* Disallow: /cvstrac/tktview* Disallow: /cvstrac/wikiedit* Disallow: /cvstrac/honeypot* Disallow: /cvstrac/wiki/attach_get* Disallow: /contrib/download* Is just a question On 16/03/07, Roger Binns [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: Another 59115 hits from the MSN bot contain the name luggle.com in the URL. This usually happens if people put broken links in their pages on their site. It can be due to just plain getting the URLs wrong or the more usual making some broken relative link instead of an intended absolute link, or half assed link obfuscation that ends up wrong. You are unlikely to be able to fix the rest of the Internet so it is best to expect broken links to the SQLite site. So the wiki server ignores it all and serves up the wiki home page. BTW that is absolutely the wrong behaviour to have. You should either return a 404 as the page really doesn't exist with helpful content as part of the 404 page, or if you really want to show the home page then redirect to it using status 301 Moved Permanently. I consider the behavior of the MSN bot to be abusive. I'm sorely tempted to ban the MSN bot from the entire sqlite.org website. Robots.txt should take care of it. You could add the luggle.com prefix to get any following to not happen. The MSN bot does look for robots.txt on my site. If SQLite ceased to be indexed by MSN, would that seriously inconvenience any users? I don't think people use MSN much, or if they do I don't think they find anything :-) On my own site this month where most visitors are coming for information about a particular cell phone, I have had 1203 referrals from google, 84 from yahoo and 13 from MSN. Looking at the logs of MSN referrals, my site is completely inappropriate for about half of them. (ie topic not covered, words not even on my site) Roger - To unsubscribe, send email to [EMAIL PROTECTED] - -- Cesar Rodas http://www.cesarodas.com/ Mobile Phone: 595 961 974165 Phone: 595 21 645590 [EMAIL PROTECTED] [EMAIL PROTECTED]
[sqlite] LEMON question
I want to know if I can here public some LEMON PARSER examples that I have done... because as i far i know LEMON is maintained into SQLite project. Best Regards -- Cesar Rodas http://www.cesarodas.com/ Mobile Phone: 595 961 974165 Phone: 595 21 645590 [EMAIL PROTECTED] [EMAIL PROTECTED]
[sqlite] Script Language
I am planning to develop a interpreted language with LEMON FLEX. The main goal is to provide a easy way to script commons actions, and to teach algorithm in my University (National University of Asuncion - Paraguay). The language have syntax as PHP and Python I am planning to create a SQLite support in the core, for teach SQL too. Is any one instresting to help in this project? Thanks to all. PD: The language doesn't have a name jet, and will be Public Domain. -- Cesar Rodas http://www.cesarodas.com/ Mobile Phone: 595 961 974165 Phone: 595 21 645590 [EMAIL PROTECTED] [EMAIL PROTECTED]
Re: [sqlite] Script Language
Your help will be welcome. On 09/03/07, Noel Frankinet [EMAIL PROTECTED] wrote: Cesar Rodas a écrit : I am planning to develop a interpreted language with LEMON FLEX. The main goal is to provide a easy way to script commons actions, and to teach algorithm in my University (National University of Asuncion - Paraguay). The language have syntax as PHP and Python I am planning to create a SQLite support in the core, for teach SQL too. Is any one instresting to help in this project? Thanks to all. PD: The language doesn't have a name jet, and will be Public Domain. No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.446 / Virus Database: 268.18.8/714 - Release Date: 8/03/2007 10:58 Hello Cesar, I am interested in the inner working of LEMON, so I am ready to help (I know tcl and Lua, but I never have devlopped an interpretor). Best regards -- Noël Frankinet Gistek Software SA http://www.gistek.net - To unsubscribe, send email to [EMAIL PROTECTED] - -- Cesar Rodas http://www.cesarodas.com/ Mobile Phone: 595 961 974165 Phone: 595 21 645590 [EMAIL PROTECTED] [EMAIL PROTECTED]
Re: [sqlite] Script Language
Will be written in C. I don't know too much of C++. Will be like python. Will have Class, Functions, and lineal execution. And I just want people to be there when i need to do test, and/or people to suggest the grammar, syntax. I mean more the Language Design. And why not helping with code On 09/03/07, Noel Frankinet [EMAIL PROTECTED] wrote: Cesar Rodas a écrit : Your help will be welcome. On 09/03/07, Noel Frankinet [EMAIL PROTECTED] wrote: Cesar Rodas a écrit : I am planning to develop a interpreted language with LEMON FLEX. The main goal is to provide a easy way to script commons actions, and to teach algorithm in my University (National University of Asuncion - Paraguay). The language have syntax as PHP and Python I am planning to create a SQLite support in the core, for teach SQL too. Is any one instresting to help in this project? Thanks to all. PD: The language doesn't have a name jet, and will be Public Domain. No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.446 / Virus Database: 268.18.8/714 - Release Date: 8/03/2007 10:58 Hello Cesar, I am interested in the inner working of LEMON, so I am ready to help (I know tcl and Lua, but I never have devlopped an interpretor). Best regards -- Noël Frankinet Gistek Software SA http://www.gistek.net - To unsubscribe, send email to [EMAIL PROTECTED] - No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.446 / Virus Database: 268.18.8/714 - Release Date: 8/03/2007 10:58 Just tell me what you expect from me. Do you have a description of the language ( a grammar ?), is it object based, object orientated or just procedural. Do you want to implement it in pure C or a mixture of C and C++. Is SQL a part of the language ? -- Noël Frankinet Gistek Software SA http://www.gistek.net - To unsubscribe, send email to [EMAIL PROTECTED] - -- Cesar Rodas http://www.cesarodas.com/ Mobile Phone: 595 961 974165 Phone: 595 21 645590 [EMAIL PROTECTED] [EMAIL PROTECTED]
[sqlite] Update question
Hello to all I want to know if sqlite supports updates to more than a table, as mysql allows Ex: UPDATE items,month SET items.price=month.price WHERE items.id=month.id; Thanks to all
Re: [sqlite] Update question
Thank you samuel On 07/03/07, Samuel R. Neff [EMAIL PROTECTED] wrote: Try this: UPDATE items SET price = ( SELECT price FROM month WHERE id = items.id) WHERE id IN (SELECT id from month); HTH, Sam --- We're Hiring! Seeking a passionate developer to join our team building products. Position is in the Washington D.C. metro area. If interested contact [EMAIL PROTECTED] -Original Message- From: Cesar Rodas [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 07, 2007 2:53 PM To: sqlite-users@sqlite.org Subject: [sqlite] Update question Hello to all I want to know if sqlite supports updates to more than a table, as mysql allows Ex: UPDATE items,month SET items.price=month.price WHERE items.id=month.id; Thanks to all - To unsubscribe, send email to [EMAIL PROTECTED] - -- Cesar Rodas http://www.sf.net/projects/pagerank (The PageRank made easy...) http://www.sf.net/projects/fastfs ( The Fast File System) Mobile Phone: 595 961 974165 Phone: 595 21 645590 [EMAIL PROTECTED] [EMAIL PROTECTED]
[sqlite] Lemon example
Here is Lemon tutorial. Shows how to make a calculator with a feature of use Parents () in math expression. http://www.cesarodas.com/2007/03/creating-basic-calculator-with-lemon.html. The author disclaims the copyright of the calculator. -- Cesar Rodas http://www.sf.net/projects/pagerank (The PageRank made easy...) http://www.sf.net/projects/fastfs ( The Fast File System) Mobile Phone: 595 961 974165 Phone: 595 21 645590 [EMAIL PROTECTED] [EMAIL PROTECTED]
Re: [sqlite] Lemon example
The URL is ok, I opened here... try again and let me know if you could not and I will email you the content of the example. On 05/03/07, Clay Dowling [EMAIL PROTECTED] wrote: Cesar Rodas wrote: Here is Lemon tutorial. Shows how to make a calculator with a feature of use Parents () in math expression. http://www.cesarodas.com/2007/03/creating-basic-calculator-with-lemon.html . The author disclaims the copyright of the calculator. There's a problem with that URL. Could you check it, or check your server? I'd love to read the example, but my browser steadfastly refuses to resolve an address for cesarodas.com Clay Dowling -- Simple Content Management http://www.ceamus.com - To unsubscribe, send email to [EMAIL PROTECTED] - -- Cesar Rodas http://www.sf.net/projects/pagerank (The PageRank made easy...) http://www.sf.net/projects/fastfs ( The Fast File System) Mobile Phone: 595 961 974165 Phone: 595 21 645590 [EMAIL PROTECTED] [EMAIL PROTECTED]
[sqlite] BLOB question
Does any one has a C code to save a binary file into a blob, and wants to share? Because i am getting an segmentation fault error from a file that I load into memory then I generate the query with a sqlite3_mprintf.. Thanks to all -- Cesar Rodas http://www.sf.net/projects/pagerank (The PageRank made easy...) http://www.sf.net/projects/fastfs ( The Fast File System) Mobile Phone: 595 961 974165 Phone: 595 21 645590 [EMAIL PROTECTED] [EMAIL PROTECTED] - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] BLOB question
#define E_IO_COULDNT_OPEN - 1 #define E_IO_ERRO -2 #define uchar unsigned char * int LoadFileContent(uchar *path, uchar ** value, long * len) { #define Buffsize 1024*4 int n; long i=0; FILE *file; unsigned char buff[Buffsize]; if ( (file=fopen(path,rb))==0) { return E_IO_COULDNT_OPEN; } *value = malloc(Buffsize); *len = 0; fseek(file,0L,SEEK_SET); while ( (n=fread(buff,Buffsize,1,file)) 0) { if (i0) *value = realloc(*value, (i+1) * Buffsize); memcpy(*value + (i * Buffsize), buff, Buffsize); *len += n; i++; } if (n==-1) { fclose(file); return E_IO_ERRO; } fclose(file); return 0; } uchar * value; char *query; long len; if ( LoadFileContent(file.jpeg,value, len) != 0) exit(); query = sqlite3_mprintf(INSERT INTO blob VALUES('%Q') , value); /* here i have a segmentation fault! */ /** Here I compile in debug mode there segmentation fault is here */ sqlite3/printf.c LINE 608 for(i=n=0; (ch=escarg[i])!=0; i++){ escarg is NULL; I know that is not an SQLite bug. I know that that is my fault. Thanks. -- Cesar Rodas http://www.sf.net/projects/pagerank (The PageRank made easy...) http://www.sf.net/projects/fastfs ( The Fast File System) Mobile Phone: 595 961 974165 Phone: 595 21 645590 [EMAIL PROTECTED] [EMAIL PROTECTED]
Re: [sqlite] BLOB question
I found the answer!! http://www.sqlite.org/cvstrac/wiki?p=BlobExample thanks for you help too Wesley On 23/02/07, Cesar Rodas [EMAIL PROTECTED] wrote: #define E_IO_COULDNT_OPEN - 1 #define E_IO_ERRO -2 #define uchar unsigned char * int LoadFileContent(uchar *path, uchar ** value, long * len) { #define Buffsize 1024*4 int n; long i=0; FILE *file; unsigned char buff[Buffsize]; if ( (file=fopen(path,rb))==0) { return E_IO_COULDNT_OPEN; } *value = malloc(Buffsize); *len = 0; fseek(file,0L,SEEK_SET); while ( (n=fread(buff,Buffsize,1,file)) 0) { if (i0) *value = realloc(*value, (i+1) * Buffsize); memcpy(*value + (i * Buffsize), buff, Buffsize); *len += n; i++; } if (n==-1) { fclose(file); return E_IO_ERRO; } fclose(file); return 0; } uchar * value; char *query; long len; if ( LoadFileContent(file.jpeg,value, len) != 0) exit(); query = sqlite3_mprintf(INSERT INTO blob VALUES('%Q') , value); /* here i have a segmentation fault! */ /** Here I compile in debug mode there segmentation fault is here */ sqlite3/printf.c LINE 608 for(i=n=0; (ch=escarg[i])!=0; i++){ escarg is NULL; I know that is not an SQLite bug. I know that that is my fault. Thanks. -- Cesar Rodas http://www.sf.net/projects/pagerank (The PageRank made easy...) http://www.sf.net/projects/fastfs ( The Fast File System) Mobile Phone: 595 961 974165 Phone: 595 21 645590 [EMAIL PROTECTED] [EMAIL PROTECTED] -- Cesar Rodas http://www.sf.net/projects/pagerank (The PageRank made easy...) http://www.sf.net/projects/fastfs ( The Fast File System) Mobile Phone: 595 961 974165 Phone: 595 21 645590 [EMAIL PROTECTED] [EMAIL PROTECTED]
Re: [sqlite] BLOB question
Sorry I copy bad when I wanted to write #define uchar unsigned char but I did #define uchar unsigned char * On 23/02/07, Martin Jenkins [EMAIL PROTECTED] wrote: Cesar Rodas wrote: #define uchar unsigned char * suggests it's a char but is in fact a pointer to a char so the signature of LoadFileContent is actually int LoadFileContent(unsigned char **path, unsigned char ***value, ... and that triggers my three levels of indirection is usually an error alarm. You want #define uchar unsigned char /* no asterisk here */ or even better typedef unsigned char uchar; Martin - To unsubscribe, send email to [EMAIL PROTECTED] - -- Cesar Rodas http://www.sf.net/projects/pagerank (The PageRank made easy...) http://www.sf.net/projects/fastfs ( The Fast File System) Mobile Phone: 595 961 974165 Phone: 595 21 645590 [EMAIL PROTECTED] [EMAIL PROTECTED] - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] BLOB question
good idea!! i didn't think in this!! On 23/02/07, Martin Jenkins [EMAIL PROTECTED] wrote: Cesar Rodas wrote: while ( (n=fread(buff,Buffsize,1,file)) 0) { if (i0) *value = realloc(*value, (i+1) * Buffsize); memcpy(*value + (i * Buffsize), buff, Buffsize); *len += n; i++; } An afterthought, why don't you just stat the file and malloc the right sized buffer from the outset? Much easier. Martin - To unsubscribe, send email to [EMAIL PROTECTED] - -- Cesar Rodas http://www.sf.net/projects/pagerank (The PageRank made easy...) http://www.sf.net/projects/fastfs ( The Fast File System) Mobile Phone: 595 961 974165 Phone: 595 21 645590 [EMAIL PROTECTED] [EMAIL PROTECTED] - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] (newbie) pictures in tables, what's the best way ?
Save into a blob. here is a C example http://www.sqlite.org/cvstrac/wiki?p=BlobExample On 23/02/07, Stef Mientki [EMAIL PROTECTED] wrote: hello, I've started with SQLite, because it's one of the first dbases with a local filessytem without authenciation. It looks great, compared to ini-files. Now I've a basic problem: I've a table, with 10 simple fields and 1 blob field, containing a (possibly large) image. Uptill now the dbase is small so no performance problems yet. But what if it grows ? I want to look at the table in a table overview, where the blob-field just displays the type of image (identified by the fisrt 2 bytes SOI-code). When I ask for the table through a query, I get all the blob-filed information, while I only need the first 2 bytes, and only the full picture of 1 selected record. I can think of several solutions, but as my experience with databases is almost zero, I can't decide (and maybe I'm overlooking some better solutions) solution 1: add a extra field for each blob field, filled with the first 2 bytes of a blob solution 2: put the blob fields in a separate table, with a link to the main table any suggestions would be appreciated. thanks, Stef Mientki - To unsubscribe, send email to [EMAIL PROTECTED] - -- Cesar Rodas http://www.sf.net/projects/pagerank (The PageRank made easy...) http://www.sf.net/projects/fastfs ( The Fast File System) Mobile Phone: 595 961 974165 Phone: 595 21 645590 [EMAIL PROTECTED] [EMAIL PROTECTED] - To unsubscribe, send email to [EMAIL PROTECTED] -
[sqlite] misuse of aggregate function
a digest into base-16. digest should be declared as ** unsigned char digest[16] in the calling function. The MD5 ** digest is stored in the first 16 bytes. zBuf should ** be char zBuf[33]. */ static void DigestToBase16(unsigned char *digest, char *zBuf){ static char const zEncode[] = 0123456789abcdef; int i, j; for(j=i=0; i16; i++){ int a = digest[i]; zBuf[j++] = zEncode[(a4)0xf]; zBuf[j++] = zEncode[a 0xf]; } zBuf[j] = 0; } /* ** During testing, the special md5sum() aggregate function is available. ** inside SQLite. The following routines implement that function. */ void md5step(sqlite3_context *context, int argc, sqlite3_value **argv){ MD5Context *p; int i; printf(%s\n,argv[1]); if( argc1 ) return; p = sqlite3_aggregate_context(context, sizeof(*p)); if( p==0 ) return; if( !p-isInit ){ MD5Init(p); } for(i=0; iargc; i++){ const char *zData = (char*)sqlite3_value_text(argv[i]); if( zData ){ MD5Update(p, (unsigned char*)zData, strlen(zData)); } } } void md5finalize(sqlite3_context *context){ MD5Context *p; unsigned char digest[16]; char zBuf[33]; p = sqlite3_aggregate_context(context, sizeof(*p)); MD5Final(digest,p); DigestToBase16(digest, zBuf); sqlite3_result_text(context, zBuf, -1, SQLITE_TRANSIENT); } int Md5_Register(sqlite3 *db){ return sqlite3_create_function(db, md5, 1, SQLITE_UTF8, 0, 0, md5step, md5finalize); } /*** my code **/ const char *config[]= { /* Config table */ CREATE TABLE config (name VARCHAR(30) UNIQUE NOT NULL PRIMARY KEY,\ value VARCHAR(500) NOT NULL);, /* Users */ CREATE TABLE users (ID INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,\ user VARCHAR(30) UNIQUE NOT NULL, \ PASS VARCHAR(32) NOT NULL,\ NAME VARCHAR(50) NULL,\ EMAIL VARCHAR(50) NULL\ );, /* Insert */ INSERT INTO users VALUES('root',md5(\root\),'Root','[EMAIL PROTECTED]'); }; void BeginSQLiteTable() { sqlite3 *db; int rc; char *zErr; rc = sqlite3_open(scvBase.db,db); if (rc != SQLITE_OK) printf(Error loading the main DB! closing\n); rc = Md5_Register(db); for(rc=0; rc 3; rc++) { sqlite3_exec(db, config[rc], 0, 0, zErr); if (zErr!=0) { printf(Error: %s\n, zErr); free(zErr); } } sqlite3_close(db); } -- Cesar Rodas http://www.sf.net/projects/pagerank (The PageRank made easy...) http://www.sf.net/projects/fastfs ( The Fast File System) Mobile Phone: 595 961 974165 Phone: 595 21 645590 [EMAIL PROTECTED] [EMAIL PROTECTED] - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] misuse of aggregate function
Found the answer!!! :D change this query by this query INSERT INTO users(user,pass,name,email) VALUES('root',md5(root),'Root',' [EMAIL PROTECTED]'); and works very well INSERT INTO users(user,pass,name,email) VALUES('root',(select md5(root)),'Root',' [EMAIL PROTECTED]'); thanks to all On 08/02/07, Cesar Rodas [EMAIL PROTECTED] wrote: I am compliled the test_md5.c with my sqlite, but when i execute something I get the follow error Error: misuse of aggregate function md5() Any one can helpme please? Thanks to all Here i post my code /* ** SQLite uses this code for testing only. It is not a part of ** the SQLite library. This file implements two new TCL commands ** md5 and md5file that compute md5 checksums on arbitrary text ** and on complete files. These commands are used by the testfixture ** program to help verify the correct operation of the SQLite library. ** ** The original use of these TCL commands was to test the ROLLBACK ** feature of SQLite. First compute the MD5-checksum of the database. ** Then make some changes but rollback the changes rather than commit ** them. Compute a second MD5-checksum of the file and verify that the ** two checksums are the same. Such is the original use of this code. ** New uses may have been added since this comment was written. */ /* * This code implements the MD5 message-digest algorithm. * The algorithm is due to Ron Rivest. This code was * written by Colin Plumb in 1993, no copyright is claimed. * This code is in the public domain; do with it what you wish. * * Equivalent code is available from RSA Data Security, Inc. * This code has been tested against that, and is equivalent, * except that you don't need to include two pages of legalese * with every copy. * * To compute the message digest of a chunk of bytes, declare an * MD5Context structure, pass it to MD5Init, call MD5Update as * needed on buffers full of bytes, and then call MD5Final, which * will fill a supplied 16-byte array with the digest. */ #include string.h #include sqlite3.h /* * If compiled on a machine that doesn't have a 32-bit integer, * you just set uint32 to the appropriate datatype for an * unsigned 32-bit integer. For example: * * cc -Duint32='unsigned long' md5.c * */ #ifndef uint32 # define uint32 unsigned int #endif struct Context { int isInit; uint32 buf[4]; uint32 bits[2]; unsigned char in[64]; }; typedef struct Context MD5Context; /* * Note: this code is harmless on little-endian machines. */ static void byteReverse (unsigned char *buf, unsigned longs){ uint32 t; do { t = (uint32)((unsigned)buf[3]8 | buf[2]) 16 | ((unsigned)buf[1]8 | buf[0]); *(uint32 *)buf = t; buf += 4; } while (--longs); } /* The four core functions - F1 is optimized somewhat */ /* #define F1(x, y, z) (x y | ~x z) */ #define F1(x, y, z) (z ^ (x (y ^ z))) #define F2(x, y, z) F1(z, x, y) #define F3(x, y, z) (x ^ y ^ z) #define F4(x, y, z) (y ^ (x | ~z)) /* This is the central step in the MD5 algorithm. */ #define MD5STEP(f, w, x, y, z, data, s) \ ( w += f(x, y, z) + data, w = ws | w(32-s), w += x ) /* * The core of the MD5 algorithm, this alters an existing MD5 hash to * reflect the addition of 16 longwords of new data. MD5Update blocks * the data and converts bytes into longwords for this routine. */ static void MD5Transform(uint32 buf[4], const uint32 in[16]){ register uint32 a, b, c, d; a = buf[0]; b = buf[1]; c = buf[2]; d = buf[3]; MD5STEP(F1, a, b, c, d, in[ 0]+0xd76aa478, 7); MD5STEP(F1, d, a, b, c, in[ 1]+0xe8c7b756, 12); MD5STEP(F1, c, d, a, b, in[ 2]+0x242070db, 17); MD5STEP(F1, b, c, d, a, in[ 3]+0xc1bdceee, 22); MD5STEP(F1, a, b, c, d, in[ 4]+0xf57c0faf, 7); MD5STEP(F1, d, a, b, c, in[ 5]+0x4787c62a, 12); MD5STEP(F1, c, d, a, b, in[ 6]+0xa8304613, 17); MD5STEP(F1, b, c, d, a, in[ 7]+0xfd469501, 22); MD5STEP(F1, a, b, c, d, in[ 8]+0x698098d8, 7); MD5STEP(F1, d, a, b, c, in[ 9]+0x8b44f7af, 12); MD5STEP(F1, c, d, a, b, in[10]+0x5bb1, 17); MD5STEP(F1, b, c, d, a, in[11]+0x895cd7be, 22); MD5STEP(F1, a, b, c, d, in[12]+0x6b901122, 7); MD5STEP(F1, d, a, b, c, in[13]+0xfd987193, 12); MD5STEP(F1, c, d, a, b, in[14]+0xa679438e, 17); MD5STEP(F1, b, c, d, a, in[15]+0x49b40821, 22); MD5STEP(F2, a, b, c, d, in[ 1]+0xf61e2562, 5); MD5STEP(F2, d, a, b, c, in[ 6]+0xc040b340, 9); MD5STEP(F2, c, d, a, b, in[11]+0x265e5a51, 14); MD5STEP(F2, b, c, d, a, in[ 0]+0xe9b6c7aa, 20); MD5STEP(F2, a, b, c, d, in[ 5]+0xd62f105d, 5); MD5STEP(F2, d, a, b, c, in[10]+0x02441453, 9); MD5STEP(F2, c, d, a, b, in[15]+0xd8a1e681, 14); MD5STEP(F2, b, c, d, a, in[ 4]+0xe7d3fbc8, 20); MD5STEP(F2, a, b, c, d
[sqlite] Where could i find?
I am wondering if there is a place on the net that I could download all the version of sqlite? I mean sqlite v1.x.x, sqlite v2.x.x I really want the 1.x.x becouse the code is easier to understand, and is simplest that the sqlite3 -- Cesar Rodas http://www.sf.net/projects/pagerank (The PageRank made easy...) http://www.sf.net/projects/fastfs ( The Fast File System) Mobile Phone: 595 961 974165 Phone: 595 21 645590 [EMAIL PROTECTED] [EMAIL PROTECTED]
Re: [sqlite] Where could i find?
I just try-out on http://www.sqlite.org/sqlite-1.0.18.tar.gz and doesn't work... please if any body have the source.. I really need it.. thanks to all On 02/02/07, Cesar Rodas [EMAIL PROTECTED] wrote: I am wondering if there is a place on the net that I could download all the version of sqlite? I mean sqlite v1.x.x, sqlite v2.x.x I really want the 1.x.x becouse the code is easier to understand, and is simplest that the sqlite3 -- Cesar Rodas http://www.sf.net/projects/pagerank (The PageRank made easy...) http://www.sf.net/projects/fastfs ( The Fast File System) Mobile Phone: 595 961 974165 Phone: 595 21 645590 [EMAIL PROTECTED] [EMAIL PROTECTED] -- Cesar Rodas http://www.sf.net/projects/pagerank (The PageRank made easy...) http://www.sf.net/projects/fastfs ( The Fast File System) Mobile Phone: 595 961 974165 Phone: 595 21 645590 [EMAIL PROTECTED] [EMAIL PROTECTED]
Re: [sqlite] Performance test on windows
I try an very long insert without BEGIN and COMMIT and this is very slow.. with a transaction is very very fast... just try and tell us the result Gaurav On 18/01/07, Ian Frosst [EMAIL PROTECTED] wrote: It could be that there is no transaction block wrapped around the inserts (a BEGIN TRANSACTION before the start of the insert loop, and a COMMIT TRANSACTION at the end.) If there is no explicit transaction, then every insert has an implied transaction, which considerably slows down the database engine. Ian On 1/18/07, Gaurav Arora [EMAIL PROTECTED] wrote: Hi All, I am a newbie to SQlite, just saw that the performance numbers on www.sqlite.org are not reliable (as per the notce on website, http://www.sqlite.org/speed.html blocked:: http://www.sqlite.org/speed.html ) So, I thought of profiling SQlite operations, on linux platform the performance time is quite good. I build sqlite on Windows too, and saw discouraging numbers coming out of it, following are some of them. e.g. RH9: inserting 1000 records ~.07 seconds. WindowsXP: inserting 100 records ~11 seconds. inserting 1000 records ~113 seconds. May be I did something wrong for building, or the parameters passed for building sqlite werent correct. I am willing to update the test results on the site, could anyone here guide me for the things which I might be doing wrong. Thanks in advance. //Gaurav -- Cesar Rodas http://www.sf.net/projects/pagerank (The PageRank made easy...) http://www.sf.net/projects/fastfs ( The Fast File System) Mobile Phone: 595 961 974165 Phone: 595 21 645590 [EMAIL PROTECTED] [EMAIL PROTECTED]
Re: [sqlite] Database is locked when working in 2 processes
Many threads or process can read, but just one can write, and when is writen the DB is locked, even for read. On 16/01/07, Yuriy Martsynovskyy [EMAIL PROTECTED] wrote: I have a problem with SQLite when accessing DB file from two processes. Process 1 is writing to the database periodically in autocommit mode. Process 2 only reads from the same database file. After awhile Process 2 starts getting Database is locked error and can not read anymore until you close and open the process 2 again. How is such configuration supposed to work in SQLite when we need 1 writer process and 1 or more reader processes? Working on Windows XP SP2 SQLite 3.3.8 with CppSqlite3 wrapper -- Thanks, Yuriy Martsynovskyy - To unsubscribe, send email to [EMAIL PROTECTED] - -- Cesar Rodas http://www.sf.net/projects/pagerank (The PageRank made easy...) http://www.sf.net/projects/fastfs ( The Fast File System) Mobile Phone: 595 961 974165 Phone: 595 21 645590 [EMAIL PROTECTED] [EMAIL PROTECTED]
Re: [sqlite] A little help with count
select count(id), numrows as type from table union select count(id), inrows as type from table where direction = 'In' union select count(id) as id, outrows as type from table where direction = 'Out' This could be? I am sorry that i can't try here, because i am not in my work or my home, and here i don't have SQLite... try and tell if it works or not. Best Regards On 13/01/07, Lloyd Thomas [EMAIL PROTECTED] wrote: I wish to create a query where I do a number of counts on the same table but with different filters. ie: count(id) as numrows count(id) as inrows where direction = 'In' count(id) as outrows where direction = 'Out' Could I do the above in a single query? | id | date | direction | duration | cost | | 1 |2007-01-01|In| 56 | 0.00 | | 2 |2007-01-01| Out | 60 | 0.10 | | 3 |2007-01-02| Out | 47 | 0.10 | | 4 |2007-01-02|In| 120 | 0.20 | Thx Lloydie T - To unsubscribe, send email to [EMAIL PROTECTED] - -- Cesar Rodas http://www.sf.net/projects/pagerank (The PageRank made easy...) Mobile Phone: 595 961 974165 Phone: 595 21 645590 [EMAIL PROTECTED] [EMAIL PROTECTED]
Re: [sqlite] Re: A little help with count
Great solution Igor! On 13/01/07, Igor Tandetnik [EMAIL PROTECTED] wrote: Lloyd Thomas lloydie-t-d/OCxD/[EMAIL PROTECTED] wrote: I wish to create a query where I do a number of counts on the same table but with different filters. ie: count(id) as numrows count(id) as inrows where direction = 'In' count(id) as outrows where direction = 'Out' Could I do the above in a single query? select count(*) as numrows, count(case direction when 'In' then 1 else NULL end) as inrows, count(case direction when 'Out' then 1 else NULL end) as outrows from mytable; Igor Tandetnik - To unsubscribe, send email to [EMAIL PROTECTED] - -- Cesar Rodas http://www.sf.net/projects/pagerank (The PageRank made easy...) Mobile Phone: 595 961 974165 Phone: 595 21 645590 [EMAIL PROTECTED] [EMAIL PROTECTED]
Re: [sqlite] Version 3.3.9
Congratulations D. Richard Hipp. Thank for give us SQLite On 04/01/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Looks it has got faster in my particular situation. Thanks for that. RBS SQLite version 3.3.9 is now available from the SQLite website http://www.sqlite.org/ http://www.sqlite.org/download.html The more important change is a fix for an obscure bug that can lead to database corruption on multi-processor systems. Other important changes include the addition of the sqlite3_prepare_v2() API which new users should always use in place of the legacy sqlite3_prepare() API. A summary of the changes can be found at http://www.sqlite.org/changes.html A detailed listing of all changes can be found by consulting the CVSTrac timeline at http://www.sqlite.org/cvstrac/timeline There are a number of important changes to winCE and win95 support. I have no ability to test these changes. I think they work. If not, I suppose I will be hearing about it very soon now. -- D. Richard Hipp [EMAIL PROTECTED] - To unsubscribe, send email to [EMAIL PROTECTED] - - To unsubscribe, send email to [EMAIL PROTECTED] - -- Cesar Rodas http://www.phpclasses.org/grank (A PHP implementation of PageRank)
[sqlite] SQLite on tempfs
Hello I am wondering if will be faster if i create a SQLite DB in a tempfs, but with out index?
[sqlite] LEMON
Where can i find a tutorial with examples of how to use LEMON parser... because i need to build interpreted language Thanks to all -- Cesar Rodas http://www.phpclasses.org/grank (A PHP implementation of PageRank)
Re: [sqlite] LEMON
Another URL where i can find a tutorial? On 29/12/06, Lloyd [EMAIL PROTECTED] wrote: Ethereal make use of Lemon On Fri, 2006-12-29 at 11:08 -0400, Cesar Rodas wrote: Where can i find a tutorial with examples of how to use LEMON parser... because i need to build interpreted language Thanks to all __ Scanned and protected by Email scanner - To unsubscribe, send email to [EMAIL PROTECTED] - -- Cesar Rodas http://www.phpclasses.org/grank (A PHP implementation of PageRank)
Re: [sqlite] LEMON
Lemon generates C files that could be compiled in Win or Linux Right? On 29/12/06, Downey, Shawn [EMAIL PROTECTED] wrote: http://www.hwaci.com/sw/lemon/lemon.html Sorry if this link has already been pointed out to you. http://www.webdotdev.com/nvd/server-side/c/lemon-parser-generator-tutori al.html Looks OK but I have not looked at this site before. Shawn M. Downey MPR Associates 10 Maxwell Drive, Suite 204 Clifton Park, New York 12065 518-371-3983 x113 (work) 860-508-5015 (cell) -Original Message- From: Cesar Rodas [mailto:[EMAIL PROTECTED] Sent: Friday, December 29, 2006 11:17 AM To: sqlite-users@sqlite.org; [EMAIL PROTECTED] Subject: Re: [sqlite] LEMON Another URL where i can find a tutorial? On 29/12/06, Lloyd [EMAIL PROTECTED] wrote: Ethereal make use of Lemon On Fri, 2006-12-29 at 11:08 -0400, Cesar Rodas wrote: Where can i find a tutorial with examples of how to use LEMON parser... because i need to build interpreted language Thanks to all __ Scanned and protected by Email scanner -- --- To unsubscribe, send email to [EMAIL PROTECTED] -- --- -- Cesar Rodas http://www.phpclasses.org/grank (A PHP implementation of PageRank) - To unsubscribe, send email to [EMAIL PROTECTED] - -- Cesar Rodas http://www.phpclasses.org/grank (A PHP implementation of PageRank)
Re: [sqlite] Problem with sqlite3 on CGI scripts with ANSI C
Here is fixed your bug.. :D.. I'd use the Option 2. Option 1: printf(\nhello [1]); if (sqlite_open(myDB.db, db)) error_handle(db); printf(\n hello [2]); Option 2: printf(\nhello [1]); if (sqlite_open(myDB.db, db)) { error_handle(db); } printf(\n hello [2]); On 15/12/06, John Stanton [EMAIL PROTECTED] wrote: How do you set the working directory? Where is your Sqlite DB file? You are just opening a file name, not a pathname so your working directory is whatever your web server uses for CGI data. Francesco Andrisani wrote: Hi comunity, i have the follow problem. I've insert into a C-CGI page a small sqlite3 code. When i call the page from a browser, it exec a query and show on browser the entries, but it don't work. If i add a printf above the sqlite3_open() it print the message, but if i put the instruction after the sqlite2_open() it don't swow the message. Under i put my piece of code: printf(\nhello [1]); if (sqlite_open(myDB.db, db)); error_handle(db); printf(\n hello [2]); Regards. F. Francesco Andrisani Software Engineer mailto: [EMAIL PROTECTED] Gruppo Acotel http://www.acotel.com http://www.acotel.com/ Via della Valle dei Fontanili, 29 00168 Roma Tel: +39661141270 Fax +3966149936 Le informazioni contenute nella comunicazione che precede possono essere riservate e sono, comunque, destinate esclusivamente alla persona o all'ente sopraindicati. La diffusione, distribuzione e/o copiatura non autorizzata del documento trasmesso da parte di qualsiasi soggetto è proibita. La sicurezza e la correttezza dei messaggi di posta elettronica non possono essere garantite. Se avete ricevuto questo messaggio per errore, Vi preghiamo di contattarci immediatamente. Grazie. This communication is intended only for use by the addressee. It may contain confidential or privileged information. Transmission cannot be guaranteed to be secure or error-free. If you receive this communication unintentionally, please inform us immediately. Thank you. - To unsubscribe, send email to [EMAIL PROTECTED] - -- Cesar Rodas http://www.phpclasses.org/grank (A PHP implementation of PageRank)
[sqlite] File Syste
Hello to all I starting a project http://code.google.com/p/gxdfs/ that is a Distributed File System, following the white paper of GFS(Google File system). If some one want to contribute please send emails with ideas. I would like to know how sqlite works.. is there a manual that explain every .c file? -- Cesar Rodas http://www.phpclasses.org/grank (A PHP implementation of PageRank)
[sqlite] Re: File Syste
I mean.. is there a manual that explain how to use SQLite Core in low level API, like berkeley DB, without SQL. Thank to all On 13/12/06, Cesar Rodas [EMAIL PROTECTED] wrote: Hello to all I starting a project http://code.google.com/p/gxdfs/ that is a Distributed File System, following the white paper of GFS(Google File system). If some one want to contribute please send emails with ideas. I would like to know how sqlite works.. is there a manual that explain every .c file? -- Cesar Rodas http://www.phpclasses.org/grank (A PHP implementation of PageRank) -- Cesar Rodas http://www.phpclasses.org/grank (A PHP implementation of PageRank)
Re: [sqlite] Re: File Syste
I mean the SQLite Core API, something like Berkeley DB. I'd like to use SQLite B+tree API. On 13/12/06, Pat Wibbeler [EMAIL PROTECTED] wrote: The public C API is well-documented here: http://www.sqlite.org/capi3.html There may be other documentation of the internals, but I'd imagine the public API will get you pretty far. Pat -Original Message- From: Cesar Rodas [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 13, 2006 6:21 AM To: sqlite-users@sqlite.org Subject: [sqlite] Re: File Syste I mean.. is there a manual that explain how to use SQLite Core in low level API, like berkeley DB, without SQL. Thank to all On 13/12/06, Cesar Rodas [EMAIL PROTECTED] wrote: Hello to all I starting a project http://code.google.com/p/gxdfs/ that is a Distributed File System, following the white paper of GFS(Google File system). If some one want to contribute please send emails with ideas. I would like to know how sqlite works.. is there a manual that explain every .c file? -- Cesar Rodas http://www.phpclasses.org/grank (A PHP implementation of PageRank) -- Cesar Rodas http://www.phpclasses.org/grank (A PHP implementation of PageRank) - To unsubscribe, send email to [EMAIL PROTECTED] - -- Cesar Rodas http://www.phpclasses.org/grank (A PHP implementation of PageRank)
Re: [sqlite] Re: File Syste
I am developing a File System, and I'd like to use B+ Tree and not lost time and CPU understanding SQL... On 13/12/06, John Stanton [EMAIL PROTECTED] wrote: It is hard to imagine why you would want to use Sqlite B-Tree access. Kees Nuyt wrote: On Wed, 13 Dec 2006 13:02:37 -0400, you wrote: I mean the SQLite Core API, something like Berkeley DB. I'd like to use SQLite B+tree API. It has quite recently been discussed, you may want to try to search the mailing list archives. The conclusion was: the B+tree API is usable but it is easy to shoot yourself in the foot. http://www.sqlite.org/arch.html might be a good starting point for further research. - To unsubscribe, send email to [EMAIL PROTECTED] - -- Cesar Rodas http://www.phpclasses.org/grank (A PHP implementation of PageRank)