[sqlite] update statements inside select...case inside triggers

2005-07-11 Thread Simon Naunton
Hi All, I'm trying to do the following: CREATE TRIGGER trigger_name AFTER UPDATE ON table BEGIN SELECT CASE WHEN a_condition THEN UPDATE another_table SET a_field=a_value WHERE yet_another_condition WHEN another_conditon THEN UPDATE another_table SET a_field=another_value

Re: [sqlite] beginnings with sqlite

2005-07-11 Thread Chris Schirlinger
> When I launch the program with the Terminal, if I write: > ./quickStart test.db "select * from personne", all occurs well, I > receives the data contained in the table "personne". But if I write > ./quickStart test "select * from personne", therefore I the extention in > the name of the data

Re: [sqlite] limiting database size

2005-07-11 Thread Cory Nelson
sqlite is file-based. use your filesystems quota functionality. On 7/11/05, Ramon <[EMAIL PROTECTED]> wrote: > > On 7/11/05, Ramon <[EMAIL PROTECTED]> wrote: > >> I would like to know if there is a way to limit a sqlite database and then > >> be > >> able > >> to change this limit later on? > >

Re: [sqlite] limiting database size

2005-07-11 Thread Sean Heber
I want to put a limit like 10mb then later on e able to change this database limit to 15mb if I want to, is this possible? You could use auto_vacuum (so the data file shrinks when data is deleted) and check the file size so you know when it is "full." l8r Sean

[sqlite] Ticket 923 status (missing quotes in 2.8.15 .dump...)

2005-07-11 Thread Downey, Shawn
Hello, I recently had some troubles converting a database from v2.8.0 to v3.08 per the following commands (under Windows XP): sqlite ddg53.db .dump >ddg53.dump sqlite3 ddg53.db3 ".read ddg53.dump" The dump of the 2.8.0 database did not enclose varchar fields containing numbers with

Re: [sqlite] limiting database size

2005-07-11 Thread Ramon
> On 7/11/05, Ramon <[EMAIL PROTECTED]> wrote: >> I would like to know if there is a way to limit a sqlite database and then be >> able >> to change this limit later on? > > Stop inserting when it's full? > > I want to put a limit like 10mb then later on e able to change this database limit to

RE: [sqlite] Binding a column name?

2005-07-11 Thread D. Richard Hipp
On Mon, 2005-07-11 at 10:32 -0700, Brown, Dave wrote: > Wait - what if AUTOVACUUM is set on the database, and I'm the only one doing > inserts/deletes? Will I still need to sqlite3_prepare() my statements again > if auto-vacuum is on? > AUTOVACUUM does *not* invalidate prepared statements -

RE: [sqlite] Binding a column name?

2005-07-11 Thread Tim McDaniel
> -Original Message- > From: D. Richard Hipp [mailto:[EMAIL PROTECTED] > Sent: Sunday, July 10, 2005 6:01 PM > To: sqlite-users@sqlite.org > Subject: RE: [sqlite] Binding a column name? > > On Sun, 2005-07-10 at 15:34 -0700, Tim McDaniel wrote: > > > > > > If another thread or process

RE: [sqlite] Binding a column name?

2005-07-11 Thread Brown, Dave
Wait - what if AUTOVACUUM is set on the database, and I'm the only one doing inserts/deletes? Will I still need to sqlite3_prepare() my statements again if auto-vacuum is on? -Dave -Original Message- From: D. Richard Hipp [mailto:[EMAIL PROTECTED] Sent: Sunday, July 10, 2005 4:12 AM

Re: [sqlite] limiting database size

2005-07-11 Thread Jay Sprenkle
On 7/11/05, Ramon <[EMAIL PROTECTED]> wrote: > I would like to know if there is a way to limit a sqlite database and then be > able > to change this limit later on? Stop inserting when it's full?

[sqlite] Error Messages

2005-07-11 Thread Ben Clewett
Sorry to bombard with so much email. A small request for later version of SQLite. Would it be possible to change this error message: "logic error or missing database" To: "logic error, missing database, database read-only, or database directory read-only." I hope this is not unreasonable,

Re: [sqlite] Does SQLite have a fulltext search like MySQL?

2005-07-11 Thread Henry Miller
On 7/5/2005 at 17:48 Michael Grice wrote: >If not, are there plans to add this? > >I'm just a NOOB, looking to see what all SQLite can do for me, before >I go too far down this road. I was on vacation last week... For full text search I find the lucene/clucene http://lucene.apache.org/

RE: [sqlite] Possible enhancement to SQL logic

2005-07-11 Thread D. Richard Hipp
On Mon, 2005-07-11 at 14:20 +0100, Steve O'Hara wrote: > Is that statement correct Richard? > I assumed that something clever was going on with OR's such that under the > bonnet they got translated into UNION statements or similar. > SQLite does not currently optimizer ORs in any way. If you

Re: [sqlite] Possible enhancement to SQL logic

2005-07-11 Thread Ben Clewett
[EMAIL PROTECTED] wrote: Ben Clewett <[EMAIL PROTECTED]> writes: D. Richard Hipp wrote: MySQL and PostgreSQL will use the indexes here, and therefore return the result considerably faster. Really? I would be very interested to know what query plan MySQL and PostgreSQL use in this

Re: [sqlite] Possible enhancement to SQL logic

2005-07-11 Thread Derrell . Lipman
Ben Clewett <[EMAIL PROTECTED]> writes: > D. Richard Hipp wrote: >>> MySQL and PostgreSQL will use the indexes here, and therefore return the >>> result considerably faster. >>> >> Really? I would be very interested to know what >> query plan MySQL and PostgreSQL use in this example. > > It

Re: [sqlite] Possible enhancement to SQL logic

2005-07-11 Thread Ben Clewett
D. Richard Hipp wrote: MySQL and PostgreSQL will use the indexes here, and therefore return the result considerably faster. Really? I would be very interested to know what query plan MySQL and PostgreSQL use in this example. It looks like I didn't look before leaping. MySQL does do a

[sqlite] Problem with sqlite3_prepare

2005-07-11 Thread Ben Clewett
I have a problem with SQLite locking when trying to allocate memory. I don't know whether this is my problem, or something else. But the problem occurs inside SQLite. A backtrack shows: /usr/local/lib/libsqlite3.so.0(sqlite3ParserAlloc+0x26) [0x4013d1c6]

RE: [sqlite] Possible enhancement to SQL logic

2005-07-11 Thread Steve O'Hara
Is that statement correct Richard? I assumed that something clever was going on with OR's such that under the bonnet they got translated into UNION statements or similar. Steve -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] rg]On Behalf Of Dan Kennedy Sent: 11 July

[sqlite] limiting database size

2005-07-11 Thread Ramon
I would like to know if there is a way to limit a sqlite database and then be able to change this limit later on?

Re: [sqlite] Possible enhancement to SQL logic

2005-07-11 Thread Dan Kennedy
Won't work unfortunately. Currently indices are never used if the WHERE clause has an OR expression in it. --- Aaron Burghardt <[EMAIL PROTECTED]> wrote: > Try adding another index: > > CREATE INDEX a_f1_f2 ON a (f1, f2); > > Does that help? > > Aaron Burghardt > > On Jul 11, 2005, at 6:07

Re: [sqlite] Possible enhancement to SQL logic

2005-07-11 Thread D. Richard Hipp
On Mon, 2005-07-11 at 11:07 +0100, Ben Clewett wrote: > If you create a table with two indexes: > > CREATE TABLE a ( > f0 INTEGER PRIMARY KEY, > f1 INTEGER, > f2 INTEGER > ); > CREATE INDEX a_f1 ON a (f1); > CREATE INDEX a_f2 ON a (f2); > > Now execute a query using both the

Re: [sqlite] Possible enhancement to SQL logic

2005-07-11 Thread Aaron Burghardt
Try adding another index: CREATE INDEX a_f1_f2 ON a (f1, f2); Does that help? Aaron Burghardt On Jul 11, 2005, at 6:07 AM, Ben Clewett wrote: Dear SQLite, I have found a possible area where the SQL logic of SQLite is not as good as other DBMS. Like MySQL or PostgreSQL. It's a simple

[sqlite] Possible enhancement to SQL logic

2005-07-11 Thread Ben Clewett
Dear SQLite, I have found a possible area where the SQL logic of SQLite is not as good as other DBMS. Like MySQL or PostgreSQL. It's a simple thing, so I am showing it as a candidate for work. (If I could submit a patch I would :) If you create a table with two indexes: CREATE TABLE a (

[sqlite] beginnings with sqlite

2005-07-11 Thread LURKIN Denis
Hi all, I am new in the world sqlite. I was on the site and I looked at how to make to begin thanks to the link "quick start". I thus compiled the sources of sqlite 3.2.2. I have to create a data base test.db. I have to create a table "personne" and I added data there. I have write the small

Re: [sqlite] Error 21, "library routine called out of sequence"

2005-07-11 Thread Ben Clewett
Gé Thanks for the advise, I will alter my program. Do you know which compilers do need this treatment? (I am using GCC 3.3.3). Regards, Ben Gé Weijers wrote: On an almost pedantic note: declare the variable as: static volatile sig_atomic_t bKilled = 0; "volatile" keeps the compiler