Re: [sqlite] shared cache

2007-07-19 Thread Richard Klein
Richard Klein wrote: [EMAIL PROTECTED] wrote: John Stanton <[EMAIL PROTECTED]> wrote: Yes, each connection has a cache. A lot of concurrent connections means a lot of memory allocated to cache and potentially a lot of duplicated cached items. See shared cache mode for relief. Yes.

[sqlite] optimizer question

2007-07-19 Thread Colin Manning
Hi If I have a table with a couple of indexed varchar fields e.g: CREATE TABLE t (id INT, a VARCHAR(20), b VARCHAR(20)...); CREATE INDEX ia ON t(a); CREATE INDEX ib ON t(b); then will the sqlite query optimizer use these indices in these SELECT's: 1. SELECT * FROM t WHERE a LIKE 'M%'; 2.

RE: [sqlite] SELECT ORDER BY failure

2007-07-19 Thread Mark Brown
No, we are actually filling in the parameter with a valid integer value. I was just trying to say it was a parameter. > > Are you actually searching for records where F is the string "?" > > If so, why don't you try WHERE F="?" instead of leaving it with the > ? unquoted.

Re: [sqlite] SQLite on Mac

2007-07-19 Thread drh
"Ahmed Sulaiman" <[EMAIL PROTECTED]> wrote: > Hi all, > > Does SQLite work on Mac, SQLite is built into the Mac. Apple uses it for many of the applications that come on the mac, such as the email reader and safari. Just open up a terminal window and type "sqlite3" and you will see. SQLite

Re: [sqlite] Ascii data in string treated as a num

2007-07-19 Thread drh
"Michael Flum" <[EMAIL PROTECTED]> wrote: > I have a short program that requires storing of Ascii strings that > happen to be numbers. It seem that when I retrieve the data it has been > interrupted as a numeric value and is returned altered. I.E. "0E00" is > returned as "0", "" is returned as

Re: [sqlite] SQLite on Mac

2007-07-19 Thread Darren Duncan
At 11:45 AM -0400 7/19/07, Ahmed Sulaiman wrote: Hi all, Does SQLite work on Mac, and if yes, is there any Mac enabled version that I could download? Cheers SQLite just works on Mac OS X. If you have the Mac OS X Developer Tools intalled, you can just compile the normal SQLite source distro

Re: [sqlite] Ascii data in string treated as a num

2007-07-19 Thread Gerry Snyder
Michael Flum wrote: I have a short program that requires storing of Ascii strings that happen to be numbers. It seem that when I retrieve the data it has been interrupted as a numeric value and is returned altered. I.E. "0E00" is returned as "0", "" is returned as "0", "76E0" is returned as

Re: [sqlite] SQLite on Mac

2007-07-19 Thread Nigel Metheringham
On 19 Jul 2007, at 16:45, Ahmed Sulaiman wrote: Does SQLite work on Mac, and if yes, is there any Mac enabled version that I could download? SQLite is used on the Mac natively - for example Mail.app uses a SQLite DB to keep its message data straight. Try the sqlite3 shell command.

Re: [sqlite] mailing list slow?

2007-07-19 Thread Joe Wilson
--- [EMAIL PROTECTED] wrote: > Joe Wilson <[EMAIL PROTECTED]> wrote: > > I noticed delays of an hour or so in posts hitting the mailing list > > recently. > > Or is it just my mail server? > > > > The server (www.sqlite.org) seems to be doing OK. > Load average is 0.13. Nothing unusual in the

Re: [sqlite] SQLite on Mac

2007-07-19 Thread Alberto Simões
Hi On 7/19/07, Ahmed Sulaiman <[EMAIL PROTECTED]> wrote: Hi all, Does SQLite work on Mac, and if yes, is there any Mac enabled version that I could download? While there are fink and darwin ports, I would suggest you to compile it from scratch. It should work well. In my case I just needed

RE: [sqlite] SQLite on Mac

2007-07-19 Thread James Dennett
> -Original Message- > From: Ahmed Sulaiman [mailto:[EMAIL PROTECTED] > Sent: Thursday, July 19, 2007 8:46 AM > To: sqlite-users@sqlite.org > Subject: [sqlite] SQLite on Mac > > Hi all, > > Does SQLite work on Mac, and if yes, is there any Mac enabled version > that I could download?

Re: [sqlite] Duplicate Row check

2007-07-19 Thread Joe Wilson
> When i do a insert is there a way to know row already exists!! Not without querying. But you could do something like this: CREATE TABLE t1(a PRIMARY KEY, b, c); insert into t1 select 7, 'foo', 'bar' where not exists ( select null from t1 where a=7); which is similar to:

Re: [sqlite] SQLite on Mac

2007-07-19 Thread P Kishor
On 7/19/07, Ahmed Sulaiman <[EMAIL PROTECTED]> wrote: Hi all, Does SQLite work on Mac, and if yes, is there any Mac enabled version that I could download? you must be new here, as they say on ./ Yes, SQLite works just fine on Mac. Just type the words Mac and SQLite in Google. -- Puneet

[sqlite] optimizer question

2007-07-19 Thread Colin Manning
Hi If I have a table with a couple of indexed varchar fields e.g: CREATE TABLE t (id INT, a VARCHAR(20), b VARCHAR(20)...); CREATE INDEX ia ON t(a); CREATE INDEX ib ON t(b); then will the sqlite query optimizer use these indices in these SELECT's: 1. SELECT * FROM t WHERE a LIKE 'M%'; 2.

Re: [sqlite] Duplicate Row check

2007-07-19 Thread Ken
You can put a Primary Key (unique index) on the table. Then when inserting a duplicate, an error will be generated. Then test for the error. Or if you want the new row to overwrite the original use insert or replace If you goal is to keep the existing use insert or ignore. see:

[sqlite] Re: Duplicate Row check

2007-07-19 Thread Igor Tandetnik
RaghavendraK 70574 <[EMAIL PROTECTED]> wrote: Q was incomplete. When i do a insert is there a way to know row already exists!! If you have uniquness constaints in place that prevent insertion of the duplicate row, your statement will fail with SQLITE_CONSTRAINT error. Igor tandetnik

RE: [sqlite] Duplicate Row check

2007-07-19 Thread Michael Flum
If you can, define one of the data entries in your table (Schema defination) as "unique" when you create the table. The engine will then set an error condition (call the callback function) and this should prevent you from entering duplicate data and hence duplicate rows. Michael -Original

[sqlite] SQL Challenge: select stack

2007-07-19 Thread Ken
Does anyone have ideas on how to implement a stack using sql Given the following tables and data: create table stack( id integer primary key, value integer); create table stackpop ( id integer primary key, value integer ); begin; insert into stack values (1, 1234); insert into

Re: [sqlite] Duplicate Row check

2007-07-19 Thread P Kishor
On 7/19/07, RaghavendraK 70574 <[EMAIL PROTECTED]> wrote: Q was incomplete. When i do a insert is there a way to know row already exists!! what is the definition of "row already exists"? If you are concerned about a particular column, make that into a PK. If you are concerned about all the

Re: [sqlite] Importing a big text file (CSV?)

2007-07-19 Thread drh
"=?ISO-8859-1?Q?Alberto_Sim=F5es?=" <[EMAIL PROTECTED]> wrote: > Ok, for future reference (drh, please, it would be nice to add this to > the web site) That is why we have wiki (http://www.sqlite.org/cvstrac/wiki) so that you can add things like this yourself. I'm busy trying to fix database

Re: [sqlite] SELECT ORDER BY failure

2007-07-19 Thread drh
"Mark Brown" <[EMAIL PROTECTED]> wrote: > Hi- > > We have a query that is failing with SQLite error code 10: > > SELECT A, B, C, D, E, F, G > FROM Table1 > WHERE F=? > ORDER BY E > > but succeeds when the ORDER BY clause is removed. > > This database does not have any indicies on any of

Re: [sqlite] SELECT ORDER BY failure

2007-07-19 Thread Scott Baker
Mark Brown wrote: > Hi- > > We have a query that is failing with SQLite error code 10: > > SELECT A, B, C, D, E, F, G > FROM Table1 > WHERE F=? > ORDER BY E > > but succeeds when the ORDER BY clause is removed. > > This database does not have any indicies on any of the tables. Is this why

Re: [sqlite] Importing a big text file (CSV?)

2007-07-19 Thread P Kishor
On 7/19/07, Veikko Mäkinen <[EMAIL PROTECTED]> wrote: Alberto Simões wrote: > Hi > > I have a file (big file with 16 000 000 lines) with records like > > 2 3 4 > 4 3 2 > 5 4 387 > 5 8 5473 > ... > > and I want to import this to an SQLite table. > Although I can replace all this to INSERT

[sqlite] Ascii data in string treated as a num

2007-07-19 Thread Michael Flum
I have a short program that requires storing of Ascii strings that happen to be numbers. It seem that when I retrieve the data it has been interrupted as a numeric value and is returned altered. I.E. "0E00" is returned as "0", "" is returned as "0", "76E0" is returned as "76" Thanks for

[sqlite] SQLite on Mac

2007-07-19 Thread Ahmed Sulaiman
Hi all, Does SQLite work on Mac, and if yes, is there any Mac enabled version that I could download? Cheers - To unsubscribe, send email to [EMAIL PROTECTED]

Re: [sqlite] Duplicate Row check

2007-07-19 Thread Joe Wilson
> How can check if a row exists in the db or not without querying for it? Isn't the very act of asking whether it exists a query unto itself? Looking for a deal? Find great prices on flights and hotels

[sqlite] Re: Duplicate Row check

2007-07-19 Thread Igor Tandetnik
RaghavendraK 70574 <[EMAIL PROTECTED]> wrote: How can check if a row exists in the db or not without querying for it? Or in other words: how can I read a book without opening it first? Igor Tandetnik - To

Re: [sqlite] Duplicate Row check

2007-07-19 Thread RaghavendraK 70574
Q was incomplete. When i do a insert is there a way to know row already exists!! regrads ragha ** This email and its attachments contain confidential information from HUAWEI, which is intended only for the

Re: [sqlite] Importing a big text file (CSV?)

2007-07-19 Thread Alberto Simões
Ok, for future reference (drh, please, it would be nice to add this to the web site) To import: 3 5 6 3 4 6 CREATE TABLE foo (v1,v2,v3); .separator " " .import "file.dat" foo Cheers Alberto On 7/19/07, Yusuke ITO <[EMAIL PROTECTED]> wrote: Hi, COPY command (like PostgreSQL)

[sqlite] sqlite3_callback called even for empty tables

2007-07-19 Thread Stefan Kuhr
Hello everyone, I hope this is not an FAQ... In my code I call sqlite3_exec with a sqlite3_callback. I noticed that when I do a select statement, then the callback is invoked once even if the table is empty, but with all argv strings passed to the callback being NULL (however with the correct

Re: [sqlite] undefined reference to `sqlite3_open'

2007-07-19 Thread John Stanton
You don't seem to have the sqlite3 link library in your compile and link command. MaaSTaaR wrote: Hello ... firstly, sorry for my bad English. i am using SQLite with C under Linux, i wrote small file which use Glade, GTK and SQLite, but i have problem with SQLite. this is the command which

RE: [sqlite] Importing a big text file (CSV?)

2007-07-19 Thread Griggs, Donald
Regarding: "Meanwhile I found an '.import' command on SQLite, but I can't find a suitable documentation on how it works." It can be easy to miss page: http://www.sqlite.org/sqlite.html where this is documented. Basically, it sounds like you might want to invoke the command line utility,

Re: [sqlite] Importing a big text file (CSV?)

2007-07-19 Thread Veikko Mäkinen
Alberto Simões wrote: Hi I have a file (big file with 16 000 000 lines) with records like 2 3 4 4 3 2 5 4 387 5 8 5473 ... and I want to import this to an SQLite table. Although I can replace all this to INSERT commands very easily, I would like to ask first if there is any faster method. I

[sqlite] Duplicate Row check

2007-07-19 Thread RaghavendraK 70574
Hi, How can check if a row exists in the db or not without querying for it? regards ragha ** This email and its attachments contain confidential information from HUAWEI, which is intended only for the

Re: [sqlite] undefined reference to `sqlite3_open'

2007-07-19 Thread drh
MaaSTaaR <[EMAIL PROTECTED]> wrote: > Hello ... > > firstly, sorry for my bad English. > > i am using SQLite with C under Linux, i wrote small file which use Glade, > GTK and SQLite, but i have problem with SQLite. > > this is the command which i used to compile the file : "gcc `pkg-config >

[sqlite] Re: timestamp to date in a trigger

2007-07-19 Thread Igor Tandetnik
Charly Caulet <[EMAIL PROTECTED]> wrote: CREATE TRIGGER tstpTOdate1 AFTER INSERT ON contrat BEGIN UPDATE contrat SET date1=strftime("%d-%m-%Y", new.tstp) WHERE UniqueID=new.UniqueID; END; But when strftime doesn't seem to work : INSERT INTO contrat(tstp) VALUES("1184834152"); SELECT * FROM

Re: [sqlite] timestamp to date in a trigger

2007-07-19 Thread drh
"Charly Caulet" <[EMAIL PROTECTED]> wrote: > > But when strftime doesn't seem to work : > >INSERT INTO contrat(tstp) VALUES("1184834152"); > >SELECT * FROM contrat; > 1|1184834152|16-08-3239253 > - > SQLite uses the julian day number, not seconds

Re: [sqlite] Importing a big text file (CSV?)

2007-07-19 Thread Yusuke ITO
Hi, COPY command (like PostgreSQL) http://www.sqlite.org/lang_copy.html COPY tbl_foo (col1, col2, col3) FROM stdin; 2 3 4 4 3 2 5 4 387 5 8 5473 \. -- Yusuke ITO [EMAIL PROTECTED] On Thu, 19 Jul 2007 13:01:53 +0200 "Sylko Zschiedrich" <[EMAIL

Re: [sqlite] Importing a big text file (CSV?)

2007-07-19 Thread P Kishor
On 7/19/07, Alberto Simões <[EMAIL PROTECTED]> wrote: Hi I have a file (big file with 16 000 000 lines) with records like 2 3 4 4 3 2 5 4 387 5 8 5473 ... and I want to import this to an SQLite table. Although I can replace all this to INSERT commands very easily, I would like to ask first if

Re: [sqlite] Importing a big text file (CSV?)

2007-07-19 Thread Alberto Simões
I have a file (big file with 16 000 000 lines) with records like 2 3 4 4 3 2 5 4 387 5 8 5473 ... and I want to import this to an SQLite table. Although I can replace all this to INSERT commands very easily, I would like to ask first if there is any faster method. Meanwhile I found an

Re: [sqlite] undefined reference to `sqlite3_open'

2007-07-19 Thread Dan Kennedy
On Thu, 2007-07-19 at 12:52 +0300, MaaSTaaR wrote: > Hello ... > > firstly, sorry for my bad English. > > i am using SQLite with C under Linux, i wrote small file which use Glade, > GTK and SQLite, but i have problem with SQLite. > > this is the command which i used to compile the file : "gcc

[sqlite] Importing a big text file (CSV?)

2007-07-19 Thread Sylko Zschiedrich
We are using precompiled insert statements and bind the parameters. The inserts were done in a transaction that is committed and reopened every 1000 iterations. Ciao Sylko -Ursprüngliche Nachricht- Von: Alberto Simões [mailto:[EMAIL PROTECTED] Gesendet: Donnerstag, 19. Juli 2007 11:57

[sqlite] Importing a big text file (CSV?)

2007-07-19 Thread Alberto Simões
Hi I have a file (big file with 16 000 000 lines) with records like 2 3 4 4 3 2 5 4 387 5 8 5473 ... and I want to import this to an SQLite table. Although I can replace all this to INSERT commands very easily, I would like to ask first if there is any faster method. Cheers Alberto -- Alberto

[sqlite] undefined reference to `sqlite3_open'

2007-07-19 Thread MaaSTaaR
Hello ... firstly, sorry for my bad English. i am using SQLite with C under Linux, i wrote small file which use Glade, GTK and SQLite, but i have problem with SQLite. this is the command which i used to compile the file : "gcc `pkg-config --libs --cflags gtk+-2.0 libglade-2.0 sqlite` -o main

[sqlite] timestamp to date in a trigger

2007-07-19 Thread Charly Caulet
Hello. I would like to convert a TIMESTAMP into date thanks to a trigger. I tried with strftime but it doesn't work (see below). Is there an other solution ? I have a table like this : CREATE TABLE contrat(UniqueID INTEGER PRIMARY KEY, tstp

Re: [sqlite] Prepared Statement (select * from x where y in ());

2007-07-19 Thread Scott Hess
Long ago and far away, I build a database abstraction layer which used ?@ for this. So you'd say something like: stmt = prepare("select * from table where xyz in (?@)"); bind_array(stmt, 0, arrayRef); The library would take the array, quote each element, and separate them with commas. It