Re: [sqlite] PS Re: [sqlite] two process problem

2007-02-03 Thread Jay Sprenkle
I have 2 processes running one is updating portions of a table and >>one is inserting. > > >Are you using threads? There are some issues using the same database handle >with multiple threads. Each process is single threaded. Your error messages don't look familiar. What language are you

[sqlite] CREATE TABLE AS drops column constraint; PRAGMA TABLE_INFO doesn't show the constraint

2007-02-03 Thread Gerry Snyder
I assume that both behaviors, as illustrated below, are by design. My question is whether there is an easier way to make a copy of a table, including column constraints, than parsing the sql in sqlite_master . I don't mind doing that, since it is not a really big deal in Tcl, but I don't want

[sqlite] Re: Memory database to file

2007-02-03 Thread A. Pagaltzis
* David Champagne <[EMAIL PROTECTED]> [2007-02-01 15:45]: > I suppose since no one replied to this, that it's not possible > to do it. Just wanted to confirm. Thank you... http://en.wikipedia.org/wiki/Warnock%27s_Dilemma :-) Regards, -- Aristotle Pagaltzis //

[sqlite] Re: UPDATE OR REPLACE same as UPDATE?

2007-02-03 Thread A. Pagaltzis
* Joe Wilson <[EMAIL PROTECTED]> [2007-02-04 00:25]: > Does anyone know whether UPDATE OR REPLACE is portable to any > other popular database? Not to MySQL. I don’t have any experience with other engines, much as I wish. (I’d much prefer PostgreSQL but I have no choice.) Regards, -- Aristotle

[sqlite] Re: UNIQUE constraint on column

2007-02-03 Thread A. Pagaltzis
* Dennis Cote <[EMAIL PROTECTED]> [2007-02-03 17:20]: > I suspect the reduction from executing three statements > (insert, select, insert) down to only two (insert insert) would > probably provide about the same performance increase as the 5% > to 10% speedup he saw by replacing the separate

[sqlite] PS Re: [sqlite] two process problem

2007-02-03 Thread Tom Shaw
At 4:59 PM -0600 2/3/07, Jay Sprenkle wrote: On 2/3/07, Tom Shaw <[EMAIL PROTECTED]> wrote: I have 2 processes running one is updating portions of a table and one is inserting. Are you using threads? There are some issues using the same database handle with multiple threads. Each process

Re: [sqlite] two process problem

2007-02-03 Thread Tom Shaw
At 4:59 PM -0600 2/3/07, Jay Sprenkle wrote: On 2/3/07, Tom Shaw <[EMAIL PROTECTED]> wrote: I have 2 processes running one is updating portions of a table and one is inserting. Are you using threads? There are some issues using the same database handle with multiple threads. No, two

Re: [sqlite] UPDATE OR REPLACE same as UPDATE?

2007-02-03 Thread Joe Wilson
--- [EMAIL PROTECTED] wrote: > Joe Wilson <[EMAIL PROTECTED]> wrote: > > Is UPDATE OR REPLACE always equivalent to just UPDATE? > > No. UPDATE is the same as UPDATE OR ABORT. Try replacing > the UPDATE OR REPLACE in the following script with just > UPDATE to see the difference: > >CREATE

Re: [sqlite] two process problem

2007-02-03 Thread Jay Sprenkle
On 2/3/07, Tom Shaw <[EMAIL PROTECTED]> wrote: I have 2 processes running one is updating portions of a table and one is inserting. Are you using threads? There are some issues using the same database handle with multiple threads. -- -- The PixAddixImage Collector suite:

[sqlite] two process problem

2007-02-03 Thread Tom Shaw
I have 2 processes running one is updating portions of a table and one is inserting. I don't accumulate updates but rather update a record at a time to keep the time of locking down. (eg begin update commit) Likewise, I only insert one at a time for the same reason. Each process works fine

Re: [sqlite] UPDATE OR REPLACE same as UPDATE?

2007-02-03 Thread drh
Joe Wilson <[EMAIL PROTECTED]> wrote: > Is UPDATE OR REPLACE always equivalent to just UPDATE? > No. UPDATE is the same as UPDATE OR ABORT. Try replacing the UPDATE OR REPLACE in the following script with just UPDATE to see the difference: CREATE TABLE t1(x UNIQUE, y); INSERT INTO t1

[sqlite] UPDATE OR REPLACE same as UPDATE?

2007-02-03 Thread Joe Wilson
Is UPDATE OR REPLACE always equivalent to just UPDATE? Food fight? Enjoy some healthy debate in the Yahoo! Answers Food & Drink Q http://answers.yahoo.com/dir/?link=list=396545367

RE: [sqlite] Another sybase conversion question

2007-02-03 Thread Joe Wilson
It will work fine, just remember to specify every column in the table being updated (aka "REPLACEd INTO") or they will contain NULL. It would be nice if SQLite featured an "INSERT OR MERGE" or "MERGE INTO" command that would not require specifying all the columns. i.e., grab the old row's values

RE: [sqlite] Another sybase conversion question

2007-02-03 Thread Anderson, James H \(IT\)
Thanks, Joe! That looks like it might be the solution. -Original Message- From: Joe Wilson [mailto:[EMAIL PROTECTED] Sent: Friday, February 02, 2007 9:58 PM To: sqlite-users@sqlite.org Subject: Re: [sqlite] Another sybase conversion question --- "Anderson, James H (IT)" <[EMAIL

RE: [sqlite] Another sybase conversion question

2007-02-03 Thread Anderson, James H \(IT\)
Thanks, Rich. Yes, I have the book and it's terrific! As you say, the index is shamefully bad. I'm gradually working my way through it but I, too, am under pressure to produce results so I'm forced to ask many questions that I could probably find the answers to myself if I had more time.

Re: [sqlite] Re: UNIQUE constraint on column

2007-02-03 Thread Dennis Cote
On 2/2/07, A. Pagaltzis <[EMAIL PROTECTED]> wrote: 5-10% in his tests, as he wrote a few mails up the thread. Significant? No. Worthwhile? Apparently so, for his application. I saw that as well, but based on this: > is there a more formal mechanism for getting this value without having do

Re: [sqlite] Auto-detection of database change in multi-process environment

2007-02-03 Thread John Stanton
A trigger updating a time modified entry in an Sqlite table would do the job. [EMAIL PROTECTED] wrote: If you are just looking for a simple detection, a process could "touch" or update a flag file, which might be empty or whatever. I have not seen the C API. I am not sure about the scope or

Re: [sqlite] OR, IN: which is faster?

2007-02-03 Thread Joe Wilson
--- chueng alex1985 <[EMAIL PROTECTED]> wrote: > I don't think so. If the field has been indexed, searching speed will be > imprved very much. The query "f1 = value1 OR f1 = value2 OR f1=value3 OR > ..." will be faster if the field f1 has been indexed. On the other hand, the > clause "f1 in

Re: [sqlite] Appropriate uses for SQLite

2007-02-03 Thread David M X Green
I am new to this but are these issues those of trying to get it to do what sqlite it is not designed for. I quote the book The Definitive Guide to SQLite - Chapter 1 --- Networking " Again, most of these limitations are intentional—they are a result of SQLite’s design. Supporting high

Re: [sqlite] not allowing an empty column

2007-02-03 Thread Dan Kennedy
On Sat, 2007-02-03 at 00:53 -0600, P Kishor wrote: > how do I add a constraint to a column so neither null nor empty > strings ("") are allowed? > create table tbl(col CHECK (col IS NOT NULL AND col != '')); - To

Re: [sqlite] OR, IN: which is faster?

2007-02-03 Thread chueng alex1985
I don't think so. If the field has been indexed, searching speed will be imprved very much. The query "f1 = value1 OR f1 = value2 OR f1=value3 OR ..." will be faster if the field f1 has been indexed. On the other hand, the clause "f1 in (value1, value2, value3, ...)" seems to be slower then 'OR'