Re: [sqlite] SQL and SQLite pronounciation?

2007-04-05 Thread Dan Baker
- Original Message - 
From: Dennis Cote [EMAIL PROTECTED]

To: sqlite-users sqlite-users@sqlite.org
Sent: Wednesday, April 04, 2007 2:24 PM
Subject: [sqlite] SQL and SQLite pronounciation?



Hi All,

I have a simple question; how do you pronounce SQL and SQLite?


In the book SQLite by Chris Newman on Page 8 it states: ...it is 
pronounced sequel-lite by its creator...


DanB


-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] SQL query problem

2007-01-16 Thread Dan Baker
- Original Message - 
From: Umesh Persad [EMAIL PROTECTED]

To: sqlite-users@sqlite.org
Sent: Tuesday, January 16, 2007 10:32 AM
Subject: [sqlite] SQL query problem



Hi,
I was wondering if anyone can help with a problem I have having with SQL.
I have a table 'people' in a Sqlite database with a column 'population'. 
All I
want to do is to add up all the values in this column. When the data is in 
an

Excel file, the column adds up to 8,581,774.

I used the SQlite Database Browser (http://sqlitebrowser.sourceforge.net/)
to get the data into a Sqlite database and ran the following query:

SELECT SUM(population) FROM people

I am supposed to get 8,581,774 but instead I am getting 14898.38. I 
exported
the data back out to a csv file and checked it in Excel and all the data 
was there

adding up to 8,581,774.

So is there something wrong with my query or should the query be different 
with

Sqlite?


I'm wondering if your population values have commas in them?  1,774  This 
*may* cause some trouble for the SUM function.

Just a thought.
DanB


-
To unsubscribe, send email to [EMAIL PROTECTED]
-



[sqlite] creating indices from my app vs sqlite3.exe

2006-12-12 Thread Dan Baker

___BACKUP INFO___
I've got a single database, with about 10,000 records (the file is 944KB). 
I have a feature that will re-populate the database from external disk 
files.  If the database is already populated, then the feature just walks 
the disk files and validates that each file is already in the database.  IF 
I have good indices, the feature takes about 5 seconds to run.  IF I have 
bad indices, the feature takes about 2-5 minutes to run.



___PROBLEM INFO___
If I create 1 index from my app, the feature runs fast.
CREATE INDEX foldername_index ON cabs (foldername);

If I create 2 indices from my app, the feature runs REAL slow.
CREATE INDEX foldername_index ON cabs (foldername);
CREATE INDEX cuid_index ON cabs (cuid,duid);

If I create 1 or 2 indices from sqlite3.exe on my database, then the feature 
runs REAL FAST!



___WRAP UP___
I've been working on this all day, with little success to deterine the 
difference.  Any ideas?


My app does the following, on an already populated database:
Note: I'm using CppSQLite3 as a wrapper.

sqlite3_exec(m_pDB, CREATE INDEX foldername_index ON cabs (foldername);, 
0, 0, err);
sqlite3_exec(m_pDB, CREATE INDEX cuid_index ON cabs (cuid,duid);, 0, 0, 
err);



Any ideas why the creation of the SECOND index makes everything stop working 
right?


Thanks
DanB


-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Searching for data

2006-12-07 Thread Dan Baker

I do this in the following way:

SELECT * FROM tbl WHERE
(cola LIKE '%hello%' OR colb LIKE '%hello%' OR colc LIKE '%hello%')
AND
(cola LIKE '%juan%' OR colb LIKE '%juan%' OR colc LIKE '%juan%')
AND
(cola LIKE '%casa%' OR colb LIKE '%casa%' OR colc LIKE '%casa%')

This will return all records that have every word in them somewhere.

DanB


- Original Message - 
From: jose isaias cabrera [EMAIL PROTECTED]

To: sqlite-users@sqlite.org
Sent: Thursday, December 07, 2006 3:55 PM
Subject: [sqlite] Searching for data




Greetings.

I have a table with many columns.  I would like to find records 
google-like on all the records.  Say, for example the searching criteria 
is


hello juan casa

I would like to have any record that has all of those tokens in any of the 
columns.


how would I do that with a select?  (imagine the table has cola, colb, 
colc.)


thanks,

josé 



-
To unsubscribe, send email to [EMAIL PROTECTED]
-



[sqlite] pragma table_info(...) documentation?

2006-04-27 Thread Dan Baker
I'm needing to find some information about a table, and the table_info 
pragma seems to be the right ticket.


I've looked around, and failed, to find any documentation on this cool 
pragma.
It appears to return 6 columns of data per table-column.  I believe they are 
as follows:

[1] = column# (0...)
[2] = column name
[3] = column affinity/type
[4] = ?
[5] = ?
[6] = ?

Can someone point me to a good place about what is coming back?

Thanks
DanB



[sqlite] How to create a database without sqlite?

2006-04-14 Thread Dan Baker
I been reading this list for several days, but just started using it today.

I'm using it as an embedded database (on Windows), and want to be able to 
create the initial database from within my app --  meaning, I don't want to 
ship a database file.

What is the recommended method for creating a new database file from within my 
app? (I looked for an SQL statement, but failed to find something like CREATE 
DATABASE mydb)

I'm thinking of the following solutions:
1) Create a database with a small known table in it via sqlite.exe, and storing 
that file in my app (as a resource), and then copying that file to disk to 
create a new database.  (Then, I could drop the known small table).

2) Ship the sqlite.exe app, and launch it with the appropriate cmd line 
parameters to create the database.

SQLite looks fantastic!

Comments?
DanB