Re: [sqlite] Running SQLite3 calls in a loop.

2005-06-11 Thread Toni Spets
(Forwarded this message to the mailing list. My bad.) Hi! The program doesn't use any dynamic memory allocation at all (besides SQLite3 and another library of mine). It doesn't make any sense. I attached the main.c which is used to call SQLite3. And yes, I know it's pretty crappy code :-). Ther

Re: [sqlite] Seeking optimal way of UNION-ing

2005-06-11 Thread D. Richard Hipp
On Sat, 2005-06-11 at 12:32 -0500, Puneet Kishor wrote: > tbl1(a INTEGER PRIMARY KEY, b VARCHAR(200) UNIQUE) with 200k+ records > tbl2(a INTEGER PRIMARY KEY, b VARCHAR(200) UNIQUE) with a few k records > > SELECT * > FROM ((SELECT * FROM tbl1) UNION (SELECT * FROM tbl2)) > WHERE b = 'foo' > > or

Re: [sqlite] Running SQLite3 calls in a loop.

2005-06-11 Thread D. Richard Hipp
On Sat, 2005-06-11 at 21:33 +0300, Toni Spets wrote: > Here is a clip from GDB: > -- snip -- > Program received signal SIGSEGV, Segmentation fault. > 0xb7ebb03e in mallopt () from /lib/libc.so.6 > (gdb) bt > #0 0xb7ebb03e in mallopt () from /lib/libc.so.6 > #1 0xb7eb9c9f in free () from /lib/lib

[sqlite] Running SQLite3 calls in a loop.

2005-06-11 Thread Toni Spets
Hi! I have been working with my statistics system for a while. I was looking for a simple and fast SQL-system to use and decided to go on with SQLite. There have been many problems with SQLite3 and memory allocation. I'm using only sqlite3_exec() in my code, so it should clean up after its done,

Re: [sqlite] Seeking optimal way of UNION-ing

2005-06-11 Thread Puneet Kishor
Rats... itchy fingers on the send button... On Jun 11, 2005, at 12:32 PM, Puneet Kishor wrote: tbl1(a INTEGER PRIMARY KEY, b VARCHAR(200) UNIQUE) with 200k+ records tbl2(a INTEGER PRIMARY KEY, b VARCHAR(200) UNIQUE) with a few k records values in col(b) in tbl1 are not common with the values i

[sqlite] Seeking optimal way of UNION-ing

2005-06-11 Thread Puneet Kishor
tbl1(a INTEGER PRIMARY KEY, b VARCHAR(200) UNIQUE) with 200k+ records tbl2(a INTEGER PRIMARY KEY, b VARCHAR(200) UNIQUE) with a few k records values in col(b) in tbl1 are not common with the values in col(b) in tbl2 I want to find a given string in either tbl1 or tbl2. Which of the following

Re: [sqlite] Problem with ORDER BY involving ROUND

2005-06-11 Thread Stephen C. Gilardi
Is there any reason why ROUND doesn't return a double? Because the IEEE storage format most (all?) computers use to store floating point numbers is binary based, many values that can be stored exactly in a base 10 system are rounded slightly to fit into the binary system. This is similar to the

Re: [sqlite] Multithreading with same sqlite struct

2005-06-11 Thread Christopher R. Palmer
Dan Kennedy wrote: It's not recommended. Some operating systems (notably linux), have problems releasing file-locks established by other threads. You might be Ok on Windows, I'm not sure. But be careful, the database locking might not work. Actually, I would say that you're probably better of

Re: [sqlite] How to improve performance of SELECT... LIKE...

2005-06-11 Thread Bert Verhees
Op zaterdag 11 juni 2005 17:04, schreef Cory Nelson: > On 6/11/05, Puneet Kishor <[EMAIL PROTECTED]> wrote: > > I started with three identical tables, first with no index, second with > > regular index, third with unique index, about 2,35,000 rows. > > > > CREATE TABLE t1 (i INTEGER PRIMARY KEY, a

Re: [sqlite] How to improve performance of SELECT... LIKE...

2005-06-11 Thread Cory Nelson
On 6/11/05, Puneet Kishor <[EMAIL PROTECTED]> wrote: > I started with three identical tables, first with no index, second with > regular index, third with unique index, about 2,35,000 rows. > > CREATE TABLE t1 (i INTEGER PRIMARY KEY, a VARCHAR(200) UNIQUE, b > INTEGER DEFAULT 0); > > CREATE TABLE

[sqlite] How to improve performance of SELECT... LIKE...

2005-06-11 Thread Puneet Kishor
I started with three identical tables, first with no index, second with regular index, third with unique index, about 2,35,000 rows. CREATE TABLE t1 (i INTEGER PRIMARY KEY, a VARCHAR(200) UNIQUE, b INTEGER DEFAULT 0); CREATE TABLE t2 (i INTEGER PRIMARY KEY, a VARCHAR(200) UNIQUE, b INTEGER D

[sqlite] SQLITE_SCHEMA can't happen during transaction, right?

2005-06-11 Thread Derrell . Lipman
Let's say I start a transaction with either BEGIN IMMEDIATE or BEGIN EXCLUSIVE, by successfully going through the sqlite3_prepare(), sqlite3_step(), and sqlite3_finalize() process. 1. I then prepare a SELECT statement with sqlite3_prepare(). Since the BEGIN statement did not give me a SQLITE_SCHE

Re: [sqlite] Problem with SQL Statement

2005-06-11 Thread Dan Kennedy
The two wildcards for LIKE are '%' and '_'. http://www.sqlite.org/lang_expr.html --- [EMAIL PROTECTED] wrote: > Hello :) > > I've got a problem with a SQL Statement in which I use a string comparsion. > > I'd like to execute this: > > SELECT * FROM PLZOrt WHERE PLZ LIKE "4153*"; But when I

[sqlite] Problem with SQL Statement

2005-06-11 Thread dannyp1202
Hello :) I've got a problem with a SQL Statement in which I use a string comparsion. I'd like to execute this: SELECT * FROM PLZOrt WHERE PLZ LIKE "4153*"; But when I do this, I get nothing back. But when I execute SELECT * FROM PLZOrt WHERE PLZ LIKE "41539"; I get one record back. But this reco