Re: [sqlite] .dump-n-reload vs. vacuum - which is better?

2007-02-26 Thread Dan Kennedy
On Mon, 2007-02-26 at 17:05 -0800, Travis Daygale wrote: > I'll do that. I was troubled enough by that bug report and this new testing > info to be so motivated. :-) This would be handy for Tcl developers. In case you haven't noticed it yet, the SQL quote() function in func.c will help with

[sqlite] more questions from the reasonably naïve

2007-02-26 Thread Eric S. Johansson
I think some of these questions fall in the category of "running in the dark with scissors". If it's a simple matter of I need to read something, just point me at the appropriate documentation. I'm trying to get a handle on this cursor thing. obviously it preserves state of some sort but

RE: [sqlite] How fast is the sqlite connection created?

2007-02-26 Thread Samuel R. Neff
I ran some tests and received fairly drastic results. Our schema has 67 tables right now (once we add in the history tables, it'll have about double that) and 116 indexes, excluding the automatic primary key indexes. I ran 1,000 simple select statements SELECT COUNT(*) FROM USERS; and the

Re: [sqlite] How to read next record of a table after a query 'select from where'

2007-02-26 Thread Alex Cheng
I am using pysqlite2 to access sqlite DB. from pysqlite2 import dbapi2 as sqlite conn = sqlite.connect("db1.db") cur = conn.cursor() cur.execute() cur.fetchone() # get one record cur.fetchone() # get next record conn.close() 2007/2/20, Adriano <[EMAIL PROTECTED]>: "SELECT * FROM mytable

Re: [sqlite] .dump-n-reload vs. vacuum - which is better?

2007-02-26 Thread Travis Daygale
I'll do that. I was troubled enough by that bug report and this new testing info to be so motivated. :-) If I think about it, the copy method has "filename" as an argument, and a dump method for the tcl driver would need that too. All other methods I believe do not need to specify the

Re: [sqlite] Bug wit length() SQL Query function

2007-02-26 Thread venkat akella
Thanks Rechard and Gerry for the quick reply. I will use that alternative solution. Is there any easy way to get the size of data stored in a table, size of a row usig Sqlite C APIs? Venkat. On 2/26/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: "venkat akella" <[EMAIL PROTECTED]> wrote:

Re: [sqlite] .dump-n-reload vs. vacuum - which is better?

2007-02-26 Thread Gerry Snyder
[EMAIL PROTECTED] wrote: It would probably not require more than a few lines of TCL code to implement a "dump" command as a TCL proc. I know that copying from one database to another is not the same as dumping, but the following might be a useful starting point. It gets the filenames

Re: [sqlite] Bug wit length() SQL Query function

2007-02-26 Thread Dennis Cote
venkat akella wrote: lenght() function in SQL Query is not behaving properly. I have explained this below with an example. Select length(col1) + length(col2) + length(col3) + length(col4) from TestTable; For example, there are four columns in a table and in a row three columns (col1,

Re: [sqlite] Question about LIKE

2007-02-26 Thread drh
"Doug" <[EMAIL PROTECTED]> wrote: > I appologize if this has been answered--haven't found it in the docs, wiki > or mail archive. > > I have a text column with the following text value in it: > c:\Temp\Temp1\Audit1.log > > I'm trying to figure out how LIKE works. When using the following

Re: [sqlite] Bug wit length() SQL Query function

2007-02-26 Thread drh
"venkat akella" <[EMAIL PROTECTED]> wrote: > Hi > > lenght() function in SQL Query is not behaving properly. I have > explained this below with an example. > >Select length(col1) + length(col2) + length(col3) + length(col4) from > TestTable; > > For example, there are four columns

Re: [sqlite] Bug wit length() SQL Query function

2007-02-26 Thread Gerry Snyder
venkat akella wrote: even if one column is NULL, then its effecting the whole query. If you want NULL treated as zero numerically for col4, use coalesce(col4,0). Or you could find a way to get 0 into the column rather than NULL before the expression is evaluated. HTH, Gerry

[sqlite] Question about LIKE

2007-02-26 Thread Doug
I appologize if this has been answered--haven't found it in the docs, wiki or mail archive. I have a text column with the following text value in it: c:\Temp\Temp1\Audit1.log I'm trying to figure out how LIKE works. When using the following patterns, I get the following results: '%audit%'

[sqlite] Bug wit length() SQL Query function

2007-02-26 Thread venkat akella
Hi lenght() function in SQL Query is not behaving properly. I have explained this below with an example. Select length(col1) + length(col2) + length(col3) + length(col4) from TestTable; For example, there are four columns in a table and in a row three columns (col1, col2 and col3)

Re: [sqlite] .dump-n-reload vs. vacuum - which is better?

2007-02-26 Thread drh
Travis Daygale <[EMAIL PROTECTED]> wrote: > That is useful to know (i.e. non-testing of the shell). Thanks. > > Does "the core" include the tcl driver (what I use)? (It must- the driver is > in there and the testing is done with tcl, all of this being partly why I > chose tcl for my app- but

Re: [sqlite] .dump-n-reload vs. vacuum - which is better?

2007-02-26 Thread Travis Daygale
That is useful to know (i.e. non-testing of the shell). Thanks. Does "the core" include the tcl driver (what I use)? (It must- the driver is in there and the testing is done with tcl, all of this being partly why I chose tcl for my app- but I want to make sure I'm not somehow

Re: [sqlite] .dump-n-reload vs. vacuum - which is better?

2007-02-26 Thread drh
Travis Daygale <[EMAIL PROTECTED]> wrote: > Tangentially, but hopefully in keeping with this thread, for the 3.3.9 > release, the change log shows: > Fixed the ".dump" command in the command-line shell to show indices, triggers > and views again. > > There was apparently a bug there. I was

RE: [sqlite] .dump-n-reload vs. vacuum - which is better?

2007-02-26 Thread James Dennett
>From what I know, it seems plausible that a filesystem snapshot should provide a robust backup for an SQLite3 database; most modern OS's have some way to atomically grab an image of a filesystem (LVM on Linux, VSS on Windows, fssnap on Solaris, etc.). I'm no SQLite expert though, so I'd suggest

Re: [sqlite] .dump-n-reload vs. vacuum - which is better?

2007-02-26 Thread Travis Daygale
Tangentially, but hopefully in keeping with this thread, for the 3.3.9 release, the change log shows: Fixed the ".dump" command in the command-line shell to show indices, triggers and views again. There was apparently a bug there. I was unaffected but _apparently_ would have been hurt had I

Re: [sqlite] developers mailing list

2007-02-26 Thread Jakub Ladman
Ok, now is it linked together, i will try, if it is functional. Jakub Ladman Dne pondělí 26 únor 2007 20:23 Martin Jenkins napsal(a): > Jakub Ladman wrote: > > but after correction of this i get: > > > > libsqlite3.a -lpthread > > libsqlite3.a(os_unix.o): In function

Re: [sqlite] developers mailing list

2007-02-26 Thread Jakub Ladman
more accurately ranlib libsqlite3.a sh4-pc-linux-uclibc-gcc -Os -DNDEBUG=1 -DHAVE_FDATASYNC=1 -DNO_TCL -DTHREADSAFE=1 -DHAVE_USLEEP=1 -I. -I../sqlite-3.3.13/src -o sqlite3 ../sqlite-3.3.13/src/shell.c \ libsqlite3.a -lpthread libsqlite3.a(os_unix.o): In function

Re: [sqlite] developers mailing list

2007-02-26 Thread Martin Jenkins
Jakub Ladman wrote: but after correction of this i get: libsqlite3.a -lpthread libsqlite3.a(os_unix.o): In function `sqlite3UnixDlopen': os_unix.c:(.text+0x848): undefined reference to `dlopen' libsqlite3.a(os_unix.o): In function `sqlite3UnixDlsym': os_unix.c:(.text+0x85c):

Re: [sqlite] Re: sqlite / tcl syntax help

2007-02-26 Thread Jeff Godfrey
Michael / Richard / Dennis, Thanks for the additional input. Problem fixed... Jeff - To unsubscribe, send email to [EMAIL PROTECTED] -

Re: [sqlite] Re: sqlite / tcl syntax help

2007-02-26 Thread Dennis Cote
Jeff Godfrey wrote: So, how can I get the correct column types returned for all columns, while at the same time properly handle column names containing spaces? Thanks for any insight. Jeff Answering my own post, I just found that the following works as expected...

Re: [sqlite] developers mailing list

2007-02-26 Thread Jakub Ladman
Dne pondělí 26 únor 2007 12:25 Gunnar Roth napsal(a): > Jakub Ladman schrieb: > >> It's seems a bit strange to me that Makefile.linux-gcc includes tcl in > >> the build by default, but it does. Maybe that should change... > >> > >> If you add "-DNO_TCL" to the OPTS variable in Makefile.linux-gcc

Re: [sqlite] sqlite / tcl syntax help

2007-02-26 Thread drh
"Jeff Godfrey" <[EMAIL PROTECTED]> wrote: > Hi All, > > I'm trying to determine the datatype of a given column using Tcl and the > following code snippet... > > set dataType [$db onecolumn "select typeof($colName) from $table"] > Try this: set quotedColName [string subst {" ""} $colName]

Re: [sqlite] sqlite / tcl syntax help

2007-02-26 Thread Michael Schlenker
Jeff Godfrey schrieb: - Original Message - From: "Michael Schlenker" <[EMAIL PROTECTED]> set dataType [$db onecolumn {select typeof($colName) from $table}] should do what you want. Note the {} instead of the "", which prevent early substitution, so sqlite can use the $colName as a

Re: [sqlite] How fast is the sqlite connection created?

2007-02-26 Thread Martin Jenkins
Samuel R. Neff wrote: Thank you for the testing and information. ;) When I have time to run some tests using our actual schema (120+ tables, several hundred indexes) I'll post back here in case others are interested in our results. From your tests it looks like more complex schemas probably

Re: [sqlite] sqlite / tcl syntax help

2007-02-26 Thread Jeff Godfrey
- Original Message - From: "Michael Schlenker" <[EMAIL PROTECTED]> set dataType [$db onecolumn {select typeof($colName) from $table}] should do what you want. Note the {} instead of the "", which prevent early substitution, so sqlite can use the $colName as a bind variable.

[sqlite] Re: sqlite / tcl syntax help

2007-02-26 Thread Jeff Godfrey
> So, how can I get the correct column types returned for all > columns, while at the same time properly handle column > names containing spaces? > Thanks for any insight. > Jeff Answering my own post, I just found that the following works as expected... set dataType [$db onecolumn "select

Re: [sqlite] sqlite / tcl syntax help

2007-02-26 Thread Michael Schlenker
Jeff Godfrey schrieb: Hi All, I'm trying to determine the datatype of a given column using Tcl and the following code snippet... set dataType [$db onecolumn "select typeof($colName) from $table"] Read about the Tcl substitution rules ( http://www.tcl.tk/man/tcl8.4/TclCmd/Tcl.htm#M11 , [4]

RE: [sqlite] How fast is the sqlite connection created?

2007-02-26 Thread Samuel R. Neff
Martin, Thank you for the testing and information. We're just starting to use SQLite and are using SQLite.NET. This library doesn't support connection pooling and we've been discussing whether to implement connection pooling external to the library. Your post certainly makes it look

[sqlite] sqlite / tcl syntax help

2007-02-26 Thread Jeff Godfrey
Hi All, I'm trying to determine the datatype of a given column using Tcl and the following code snippet... set dataType [$db onecolumn "select typeof($colName) from $table"] This works correctly as long as $colName (the name of the current column) doesn't contain a space. When the column

Re: [sqlite] How fast is the sqlite connection created?

2007-02-26 Thread Martin Jenkins
Martin Jenkins wrote: So the difference in connect times between a database with 1 table and 10 tables is ... It appears that adding indexes (and triggers?) increases the time at about the same rate as adding tables. That is a connect/first select to a database with 1 table and 3 indexes

Re: [sqlite] How fast is the sqlite connection created?

2007-02-26 Thread Martin Jenkins
Peter van Dijk wrote: every time you open an sqlite database file, the sqlite library has to parse all table structures. It is much better to keep your connection/handle open for longer periods of time. On my XP box it takes about 220us to connect to an SQLite database from Python, whether

Re: [sqlite] db design options

2007-02-26 Thread Dennis Cote
P Kishor wrote: On 2/23/07, Dennis Cote <[EMAIL PROTECTED]> wrote: P Kishor wrote: > > > Most of the time I am looking at one site, so there is a speed gain by > not plowing through other sites' data. This is what is causing me to > pause before I rush forward. > If you have an index on the

Re: [sqlite] Using same database with multiple processes

2007-02-26 Thread Thomas Dybdahl Ahle
man, 26 02 2007 kl. 07:10 +, skrev Martin Jenkins: > Thomas Dybdahl Ahle wrote: > > Hi, I'm running a project using pysqlite for database support. It's > > awsome. > > Now I have a user who produces this warning: "Warning: You can only > > execute one statement at a time." > > Hard to say

Re: [sqlite] compiling with VC++

2007-02-26 Thread Dennis Jenkins
RB Smissaert wrote: Did you make the alterations to make the dll VB compatible? Nope. C/C++ all the way. - To unsubscribe, send email to [EMAIL PROTECTED]

[sqlite] PRAGMA temp_store -- is there a default_temp_store?

2007-02-26 Thread Samuel R. Neff
The SQLite optimization faq [1] mentions a PRAGMA default_temp_store which should set temp_store on a per-database level. However this doesn't seem to be correct--the official docs [2] don't mention default_temp_store and calling "PRAGMA default_temp_store;" always returns nothing (although

Re: [sqlite] Re: trigger with conditions

2007-02-26 Thread anis chaaba
Thx :) 2007/2/26, Igor Tandetnik <[EMAIL PROTECTED]>: anis chaaba <[EMAIL PROTECTED]> wrote: > Can you tell how can i trigger with conditions such as: > create trigger foo > begin > if (NEW.VALUE = 'something') > insert into tables values.. > endif > END;

[sqlite] Re: trigger with conditions

2007-02-26 Thread Igor Tandetnik
anis chaaba <[EMAIL PROTECTED]> wrote: Can you tell how can i trigger with conditions such as: create trigger foo begin if (NEW.VALUE = 'something') insert into tables values.. endif END; http://sqlite.org/lang_createtrigger.html create trigger foo after update on someTable when new.value

Re: [sqlite] developers mailing list

2007-02-26 Thread Dan Kennedy
On Mon, 2007-02-26 at 11:37 +0100, Jakub Ladman wrote: > > It's seems a bit strange to me that Makefile.linux-gcc includes tcl in > > the build by default, but it does. Maybe that should change... > > > > If you add "-DNO_TCL" to the OPTS variable in Makefile.linux-gcc this > > error should go

Re: [sqlite] developers mailing list

2007-02-26 Thread Gunnar Roth
Jakub Ladman schrieb: It's seems a bit strange to me that Makefile.linux-gcc includes tcl in the build by default, but it does. Maybe that should change... If you add "-DNO_TCL" to the OPTS variable in Makefile.linux-gcc this error should go away. i.e. add the following line somewhere after the

[sqlite] trigger with conditions

2007-02-26 Thread anis chaaba
Hello people, Can you tell how can i trigger with conditions such as: create trigger foo begin if (NEW.VALUE = 'something') insert into tables values.. endif END; thanks in advance - To unsubscribe, send email to

Re: [sqlite] The best way to delete a column ?

2007-02-26 Thread Martin Jenkins
Stef Mientki wrote: I just read it's not possible to delete a column in an existing table. Now what would be the best way to remove the column indirect (from Delphi code), I've never needed to do this so the following are just hints. The special table "sqlite_master" contains the SQL that was

[sqlite] The best way to delete a column ?

2007-02-26 Thread Stef Mientki
hello, I just read it's not possible to delete a column in an existing table. Now what would be the best way to remove the column indirect (from Delphi code), would it be something like this: start transaction create new table with the same structure, but without the column to delete (how?)

Re: [sqlite] How fast is the sqlite connection created?

2007-02-26 Thread Peter van Dijk
On Feb 25, 2007, at 10:03 AM, Alex Cheng wrote: I want to know how many time is spent when create a sqlite connection. Is it effeciency? My application creates a connection and close it when access DB everytime, is it OK? Hello Alex, every time you open an sqlite database file, the

Re: [sqlite] Sqlite3 in MAC Os

2007-02-26 Thread Martin Jenkins
Kirrthana M wrote: Im developing an application using sqlite3 in MAC OS,I just wanted to know wheather sqlite3 can be used in MAC OS. I don't use Mac, but I *think* SQLite is bundled with later versions. If so can the same sqlite3 library and the executable used in windows can be used in MAC