Re: [sqlite] LIKE returns all rows

2005-04-23 Thread Edward Macnaghten
steve wrote: Ah, that works just fine. Is this noted someplace in the documentation that I missed? If not: - why does it work with single quotes and not double? - Shouldn't it be added? Double quotes and single quotes have different meanings in SQLite (as defined in ANSI SQL too). To produce

RE: [sqlite] LIKE returns all rows

2005-04-23 Thread steve
Ah, that works just fine. Is this noted someplace in the documentation that I missed? If not: - why does it work with single quotes and not double? - Shouldn't it be added? This is all I found on the "Datatypes in SQLite Version 3" page: "Values specified as literals as part of SQL statements

Re: [sqlite] LIKE returns all rows

2005-04-23 Thread Scott Leighton
On Saturday 23 April 2005 7:15 pm, steve wrote: > Assume a database table named Good has a column named "bob". > The following command will return ALL rows in the table regardless of their > content: > > SELECT * FROM Good WHERE bob LIKE "bob"; > > Is this by design? If so, is there a workaround

Re: [sqlite] LIKE returns all rows

2005-04-23 Thread Scott Leighton
On Saturday 23 April 2005 7:15 pm, steve wrote: > Assume a database table named Good has a column named "bob". > The following command will return ALL rows in the table regardless of their > content: > > SELECT * FROM Good WHERE bob LIKE "bob"; > > Is this by design? If so, is there a workaround

[sqlite] LIKE returns all rows

2005-04-23 Thread steve
Assume a database table named Good has a column named "bob". The following command will return ALL rows in the table regardless of their content: SELECT * FROM Good WHERE bob LIKE "bob"; Is this by design? If so, is there a workaround for this other than attempting to name all columns in a

[sqlite] LIKE returns all rows

2005-04-23 Thread steve
Assume a database table named Good has a column named "bob". The following command will return ALL rows in the table regardless of their content: SELECT * FROM Good WHERE bob LIKE "bob";

Re: [sqlite] Performances problem with multi-table query ?

2005-04-23 Thread Tom Poindexter
On Sat, Apr 23, 2005 at 09:04:18AM -0400, D. Richard Hipp wrote: > On Sat, 2005-04-23 at 14:25 +0200, Pierre D. wrote: > > sqlite> SELECT p.name FROM packages p, files f WHERE f.pkgid=p.pkgid AND > > f.filename="/usr/bin/gcc"; > > Reverse the order of the tables in the FROM clause. Like this: >

Re: [sqlite] Performances problem with multi-table query ?

2005-04-23 Thread D. Richard Hipp
On Sat, 2005-04-23 at 14:25 +0200, Pierre D. wrote: > I'm trying some "simple" query. The first query is "Whose file is it ?" > Here is my first SQL query for that (ran with the sqlite3 command) : > sqlite> SELECT p.name FROM packages p, files f WHERE f.pkgid=p.pkgid AND >

Re: [sqlite] Performances problem with multi-table query ?

2005-04-23 Thread Pierre D.
Le Samedi 23 Avril 2005 14:50, Tobias Rundström a écrit : > [EMAIL PROTECTED] wrote: > > Le Samedi 23 Avril 2005 14:34, Tobias Rundström a écrit : > >>select p.name from packages p join files f on f.pkgid = p.pkgid where > >>f.filename="/usr/bin/gcc"; > > > > It is as slow as the previous query :(

Re: [sqlite] Performances problem with multi-table query ?

2005-04-23 Thread Tobias Rundström
[EMAIL PROTECTED] wrote: Le Samedi 23 Avril 2005 14:34, Tobias Rundström a écrit : select p.name from packages p join files f on f.pkgid = p.pkgid where f.filename="/usr/bin/gcc"; It is as slow as the previous query :( Poor indexes? make sure that you have a index on pkgid in both tables and one

Re: [sqlite] Performances problem with multi-table query ?

2005-04-23 Thread pinaraf
Le Samedi 23 Avril 2005 14:34, Tobias Rundström a écrit : > Pierre D. wrote: > > Hi > > > > I'm currently developing a package manager (for linux) (yes I know, yet > > another, useless...) and I'm using XML files for the database. But the > > problem of that way is the slowdown and the memory cost

Re: [sqlite] Performances problem with multi-table query ?

2005-04-23 Thread Tobias Rundström
Pierre D. wrote: Hi I'm currently developing a package manager (for linux) (yes I know, yet another, useless...) and I'm using XML files for the database. But the problem of that way is the slowdown and the memory cost of xml files + XPath query So I'm exploring other ways to store the

[sqlite] Performances problem with multi-table query ?

2005-04-23 Thread Pierre D.
Hi I'm currently developing a package manager (for linux) (yes I know, yet another, useless...) and I'm using XML files for the database. But the problem of that way is the slowdown and the memory cost of xml files + XPath query So I'm exploring other ways to store the database. The first

Re: [sqlite] Where are the tables being saved?

2005-04-23 Thread Witold Czarnecki
Run: sqlite -help ...and see the sqlite's command line syntax. You should give then db filename as an parameter. Otherwise DB will be created in the memory and not saved. Best regards, Witold - Original Message - From: <[EMAIL PROTECTED]> To: Sent: Saturday,

[sqlite] Where are the tables being saved?

2005-04-23 Thread phantom21
Hello, I'm using SQLite 2.8.15 on SUSE Pro 9.2. The executable is in /usr/bin. I've been having some problems using/learning sqlite. I have the Newman book and have been trying to find where the tables/databases are being saved. Using the book, I create a couple of tables, and insert data

Re: [sqlite] strftime and the %f option

2005-04-23 Thread Will Leshner
On 4/22/05, Kurt Welgehausen <[EMAIL PROTECTED]> wrote: > Is that always true, or just when the date is 'now'? > I suspect that 'now' is producing an integer. Aha. I bet you are right. I wish I had thought to test that. Thanks.

[sqlite] strftime and the %f option

2005-04-23 Thread Will Leshner
It would appear that for a sqlite library built with CodeWarrior on the Mac, the %f option to strftime only ever retuns '000' for the milliseconds portion of the time. I'm wondering if this could be a problem with CodeWarrior, or if that's just the way things are.

Re: [sqlite] strftime and the %f option

2005-04-23 Thread Kurt Welgehausen
> ... %f option to strftime ... retu[r]ns '000' ... Is that always true, or just when the date is 'now'? I suspect that 'now' is producing an integer. sqlite> select strftime('%f', 'now'); strftime('%f', 'now') - 52.000 sqlite> select strftime('%f', 'now');

Re: [sqlite] timestamp how to ?

2005-04-23 Thread Ken & Deb Allen
Having used other databases extensively, and discovering that SQLITE does not have a native DATETIME data structure, I have elected to store the Date/Time value from the operating system (which is either a 32-bit or 64-bit value) directly into an INT field and then translate it into a string