Re: [sqlite] SQLite Transaction Rate and speed...

2009-03-11 Thread VF
Great suggestion! I wonder however how should I implement it though... I am upserting tens of millions of rows in chunks of several hundreds thousands (naturally I can't do all this in memory). SQLite tutorial says if each update/insert is not resulting in transaction, it can make up to 50k update

Re: [sqlite] Query Doesn't Find Record

2009-03-11 Thread P Kishor
On Wed, Mar 11, 2009 at 11:08 PM, jonwood wrote: > > > Doug Currie-2 wrote: >> >> Note the '/'s >> > > What does this mean? What does DATE('2009-1-1') or DATE('2009/1/1') return? > Does DATE() simply have no effect whatsoever? > -- why don't you try it? See below -- [07:42 PM] ~/Projects$sqlite

Re: [sqlite] Query Doesn't Find Record

2009-03-11 Thread Doug Currie
On Mar 12, 2009, at 12:08 AM, jonwood wrote: > Doug Currie-2 wrote: >> >> Note the '/'s >> > > What does this mean? What does DATE('2009-1-1') or DATE('2009/1/1') > return? > Does DATE() simply have no effect whatsoever? Sorry to be cryptic. sqlite> select date('2009/12/03'); sqlite> select

Re: [sqlite] Query Doesn't Find Record

2009-03-11 Thread jonwood
Doug Currie-2 wrote: > > Note the '/'s > What does this mean? What does DATE('2009-1-1') or DATE('2009/1/1') return? Does DATE() simply have no effect whatsoever? -- View this message in context: http://www.nabble.com/Query-Doesn%27t-Find-Record-tp22469520p22469578.html Sent from the SQLite

Re: [sqlite] Query Doesn't Find Record

2009-03-11 Thread Doug Currie
On Mar 12, 2009, at 12:01 AM, jonwood wrote: > PaymentDate=2009/01/05 Note the '/'s > And then I ran the following query: > > SELECT * FROM Payments WHERE FK_CustomerID=5 AND DATE(PaymentDate) >= > DATE('2009-01-01') AND DATE(PaymentDate) <= DATE('2009-03-11') Note the '-'s. '2009/' > '2009-'

[sqlite] Query Doesn't Find Record

2009-03-11 Thread jonwood
Okay, so SQLite stores dates as strings, for whatever reason. I thought I had this figured out but now I'm running into the following problem: I have a table called Payments that contains a single row of data with the following values: PaymentID=1 FK_CustomerID=5 PaymentDate=2009/01/05 PaymentTy

Re: [sqlite] Proposal for SQLite and non pure ASCII letters

2009-03-11 Thread Ian Walters
On 12/03/2009, at 12:36 PM, Jean-Christophe Deschamps wrote: > > To answer another post by Ian, yes I've had a look at ICU. Of course > ICU knows about its size, but what can they do about it, since their > goal is to implement the most complete support possible? Make parts of it be possible to

Re: [sqlite] Proposal for SQLite and non pure ASCII letters

2009-03-11 Thread John Machin
On 12/03/2009 1:36 PM, Jean-Christophe Deschamps wrote: > > BTW locales are far from perfection. For instance: you have to search > text, say an address book in a cellphone, with FTS3 and you know the > base may have words or names in a dozen european languages. How would > you do? ICU? Huge

Re: [sqlite] Proposal for SQLite and non pure ASCII letters

2009-03-11 Thread Dennis Cote
Roger Binns wrote: > Jean-Christophe Deschamps wrote: > >> I'd like to have the group opinion about a feature I would find utterly >> useful in _standard_ SQLite. >> > > You are aware that "standard" SQLite is used in devices with a few > kilobytes of memory through workstations and server

[sqlite] Proposal for SQLite and non pure ASCII letters

2009-03-11 Thread Jean-Christophe Deschamps
Roger, >You are aware that "standard" SQLite is used in devices with a few >kilobytes of memory through workstations and servers with gigabytes of it! That's precisely why such approach is interesting! >As far as I can tell you want some extra "standard" collation sequences >and propose shor

Re: [sqlite] SQLITE : Constraint question

2009-03-11 Thread Dennis Cote
REPKA_Maxime_NeufBox wrote: > ->> Why is it possible to change data not defined in the constraint : > Exemple : enter TEXT if the column is INTERGER ?? > enter 25 caracters if column is declared VARCHAR(15) ?? > I thought i will get an error return > See exemple below : > > As

Re: [sqlite] Nested SELECTS using UNION and INTERSECT syntax problems....

2009-03-11 Thread Dennis Cote
sorka wrote: > I can't for the life of me figure this out. I'm trying to do a nested select > like this: > > SELECT x FROM (( UNION ) INTERSECT ( UNION > )) WHERE X= > > Each of the select a through d statements all return the same column x. If I > remove the inner parentheses, it executes just fin

Re: [sqlite] Proposal for SQLite and non pure ASCII letters

2009-03-11 Thread Ian Walters
On 12/03/2009, at 8:15 AM, Jean-Christophe Deschamps wrote: > > I feel the need for a different implementation of collating support. > Not every user of SQLite needs full universal collating support à la > ICU. It's huge and slows things down significantly. This may be a dumb question, but why n

Re: [sqlite] Proposal for SQLite and non pure ASCII letters

2009-03-11 Thread Roger Binns
Jean-Christophe Deschamps wrote: > I'd like to have the group opinion about a feature I would find utterly > useful in _standard_ SQLite. You are aware that "standard" SQLite is used in devices with a few kilobytes of memory through workstations and servers with gigabytes of it! As far as I can

[sqlite] Proposal for SQLite and non pure ASCII letters

2009-03-11 Thread Jean-Christophe Deschamps
Hello group, I'd like to have the group opinion about a feature I would find utterly useful in _standard_ SQLite. Here's a rewrite of mails sent to hwaci about it, without success so far. Note: I guess that non pure ASCII characters in the sample strings below will translate to '?', but you c

Re: [sqlite] Slow performance with Sum function

2009-03-11 Thread Griggs, Donald
-Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Trainor, Chris Sent: Wednesday, March 11, 2009 5:31 PM To: General Discussion of SQLite Database Subject: Re: [sqlite] Slow performance with Sum function > Do not be tempted by

Re: [sqlite] Slow performance with Sum function

2009-03-11 Thread Trainor, Chris
> Do not be tempted by the incremental vacuum feature. Incremental > vacuum will reduce the database size as content is deleted, but it > will not reduce fragmentation. In fact, incremental vacuum will > likely increase fragmentation. Incremental vacuum is just a variation > on auto_vacuu

Re: [sqlite] SQLITE : Constraint question

2009-03-11 Thread Martin Engelschalk
Hi, sqlite does not enforce datatypes. In this, sqlites works differently from other database engines. See http://www.sqlite.org/different.html and search for "*Manifest typing" The key sentence is *"SQLite thus allows the user to store any value of any datatype into any column regardless of th

[sqlite] SQLITE : Constraint question

2009-03-11 Thread REPKA_Maxime_NeufBox
Hello, I am working on Database not for a long time. From SQLITE Tutorial exam table :* ->> Why is it possible to change data not defined in the constraint : Exemple : enter TEXT if the column is INTERGER ?? enter 25 caracters if column is declared VARCHAR(15) ?? I thought i will

Re: [sqlite] Are there distillate posts in the sqlite3 board?

2009-03-11 Thread Ribeiro, Glauber
I'm not sure if anyone replied further, but: when you use the Web interface to subscribe to the list: http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-announce One of the options you have is "Would you like to receive list mail batc

Re: [sqlite] SELECT queries and NULL value parameters

2009-03-11 Thread Sylvain Pointeau
you can also use ifnull(myvar1,'') = ifnull(myvar2,'') or something in the same way. I used it for avoiding creating 2 queries for each cases. Cheers, Sylvain On Wed, Mar 11, 2009 at 4:14 PM, Jim Wilcoxson wrote: > I used the Solid database for many years, since they came out with > their Lin

Re: [sqlite] SELECT queries and NULL value parameters

2009-03-11 Thread Jim Wilcoxson
I used the Solid database for many years, since they came out with their Linux version back in 1998. Initially they had this behavior. Later they added = NULL so that it worked like IS NULL. My guess is that, standard or not, this was so utterly confusing to most people that it was better to be s

Re: [sqlite] SELECT queries and NULL value parameters

2009-03-11 Thread Martin Engelschalk
Hi Tom, yes, you are right. It does not matter how you put the NULL in your query. The bind variable does not change the operator from = to IS. However, if you do not want to change the SQL text, and know a value which your field will never have, and do not use an index, then you can write ---

Re: [sqlite] SELECT queries and NULL value parameters

2009-03-11 Thread Hynes, Tom
Thanks for the quick response! Yes, I understand the differences between querying with IS NULL vs. = NULL. But I had always thought that when using *parameter binding* a NULL query parameter would be treated like the IS NULL case when doing the comparison, not the equality case. Hmm, Sounds l

Re: [sqlite] SELECT queries and NULL value parameters

2009-03-11 Thread P Kishor
On Wed, Mar 11, 2009 at 9:14 AM, Hynes, Tom wrote: >> ... yes, this is expected. > > Can you explain that a bit more?  I certainly would not have expected it.   > Thanks. sqlite> CREATE TABLE foo (a); sqlite> INSERT INTO foo VALUES (1); sqlite> INSERT INTO foo VALUES ('ab'); sqlite> INSERT INTO f

Re: [sqlite] SELECT queries and NULL value parameters

2009-03-11 Thread Hynes, Tom
> ... yes, this is expected. Can you explain that a bit more? I certainly would not have expected it. Thanks. Tom -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Martin Engelschalk Sent: Wednesday, March 11, 2009 8:59 AM

Re: [sqlite] LEFT INNER JOIN a second database

2009-03-11 Thread Kees Nuyt
On Wed, 11 Mar 2009 06:12:37 -0700 (PDT), Derek Developer wrote: >I have read and searched but I am not able to >get the following statement to run: > SELECT MyID, Zip FROM TableOne d > LEFT OUTER JOIN DatabseTwo.sdb.TableTwo n > ON n.MyID=d.MyID WHERE d.Zip > 8 ORDER BY d.Zip > >I just ge

Re: [sqlite] tool to browse a sqlite database

2009-03-11 Thread RB Smissaert
This is now all sorted and it was indeed a simple bug in the wrapper. When parsing out the create table statement it hadn't anticipated the double quotes surrounding the tables and fields. I understand that this is in fact the standard/recommended way, although I don't do it myself and prefer: CREA

Re: [sqlite] insert in C

2009-03-11 Thread mrobi002
Hi Rajesh Nair, It works perfectly, Thank you, Michael > If you want to use sqlite3_exec function then try this > > char *zSQL = sqlite3_mprintf("INSERT INTO probes VALUES(%Q)", temp); > sqlite3_exec(db, zSQL, 0, 0, 0); > sqlite3_free(zSQL); > > This will format "temp" to hold any special chars

Re: [sqlite] LEFT INNER JOIN a second database

2009-03-11 Thread John Machin
On 12/03/2009 12:12 AM, Derek Developer wrote: > I have read and searched but I am not able to get the following statement to > run: > SELECT MyID, Zip FROM TableOne d LEFT OUTER JOIN DatabseTwo.sdb.TableTwo n ON > n.MyID=d.MyID WHERE d.Zip > 8 ORDER BY d.Zip > > I just get error at "." > >

Re: [sqlite] LEFT INNER JOIN a second database

2009-03-11 Thread P Kishor
On Wed, Mar 11, 2009 at 8:12 AM, Derek Developer wrote: > I have read and searched but I am not able to get the following statement to > run: > SELECT MyID, Zip FROM TableOne d LEFT OUTER JOIN DatabseTwo.sdb.TableTwo n ON > n.MyID=d.MyID WHERE d.Zip > 8 ORDER BY d.Zip > > I just get error at

[sqlite] LEFT INNER JOIN a second database

2009-03-11 Thread Derek Developer
I have read and searched but I am not able to get the following statement to run: SELECT MyID, Zip FROM TableOne d LEFT OUTER JOIN DatabseTwo.sdb.TableTwo n ON n.MyID=d.MyID WHERE d.Zip > 8 ORDER BY d.Zip I just get error at "." I tried specifiying the databse name without the file extensio

Re: [sqlite] insert in C

2009-03-11 Thread Rajesh Nair
If you want to use sqlite3_exec function then try this char *zSQL = sqlite3_mprintf("INSERT INTO probes VALUES(%Q)", temp); sqlite3_exec(db, zSQL, 0, 0, 0); sqlite3_free(zSQL); This will format "temp" to hold any special chars which may generate some errors. eg:- temp = " Rajesh's Test " will be

Re: [sqlite] SELECT queries and NULL value parameters

2009-03-11 Thread Martin Engelschalk
Hi, yes, this is expected. Note that you use the = - operator in WHERE maybenullcolumn = @value and NULL = NULL evaluates to false. This is SQL standard. Martin diego.d...@bentley.com wrote: > Hello, > > In my usage of SQLite, I found a behavior that might be considered a > bug, but I would lik

[sqlite] SELECT queries and NULL value parameters

2009-03-11 Thread Diego.Diaz
Hello, In my usage of SQLite, I found a behavior that might be considered a bug, but I would like others' input on it. Consider the following table with a single row, with one column containing a null value: CREATE TABLE MyTable (id integer primary key autoincrement, label char(255), maybenullco

Re: [sqlite] insert in C

2009-03-11 Thread Martin Engelschalk
Hi, use sqlite3_prepare and sqlite3_bind. See http://www.sqlite.org/capi3ref.html#sqlite3_prepare and sqlite3_bind_text under http://www.sqlite.org/capi3ref.html#sqlite3_bind_blob const char* szTail=0; sqlite3_stmt* pVM; int nRet = sqlite3_prepare(mpDB, "insert into table1 values(?)",

[sqlite] insert in C

2009-03-11 Thread mrobi002
Good Morning, I would like to write in C the equivalent code for: insert into table1 values('Hello'); using a variable char temp[20]= "Hello"; instead of the literal Hello I have used multiple variations of the following, but no luck char temp[20]= "Hello"; sql = "INSERT INTO pro

Re: [sqlite] Extract error text in C API

2009-03-11 Thread Andy Sharp
I did see that function and I had already tried that but it just gives me "SQL logic error or missing database". The error code from the step command is 19 (constraint error). I t almost looks like a different error, but if I take out the triggers it works. Thanks Andy On Wed, Mar 11, 2009 a

Re: [sqlite] SQLite Transaction Rate and speed...

2009-03-11 Thread Jim Ursetto
At 03:47am on 2009 March 08, VF did write: > CREATE UNIQUE INDEX MAP_IDX_$idx ON MAPPINGS_$idx (key, mapping); > CREATE INDEX KEY_IDX_$idx ON MAPPINGS_$idx(key); > > I am trying to do an upsert with the following logic: > > UPDATE MAPPINGS_$idx > SET counter = counter + 1 > , timeModified = CURR

Re: [sqlite] get_table and bind

2009-03-11 Thread galeazzi
Citando Igor Tandetnik : > galea...@korg.it wrote: >> is it possible to use a similar function to get_table but starting by >> a statement in order to use the bind facilities? > > Anything wrong with calling sqlite3_step in a loop? > > Igor Tandetnik > > > > ___

Re: [sqlite] "Vacuum" command is failing with "SQL Error:Database or disk is full"

2009-03-11 Thread Mihai Limbasan
manohar s wrote: > Hi, > I am trying to execute "PRAGMA page_size=4096; Vacuum;" on a SQLite DB(Size > 1.5 GB), On a drive which has 9 GB free space (But my C: has 150 MB free is > this an issue?). But it is failing with "SQL Error:Database or disk is full" > error everytime. SQLite version: 3.6.1