Re: [sqlite] Named parameters and spaces.

2012-01-10 Thread Steven Michalske
On Jan 10, 2012, at 5:02 PM, Darren Duncan wrote: > Steven Michalske wrote: >> On Tue, Jan 10, 2012 at 3:19 PM, Darren Duncan >> wrote: >>> Steven Michalske wrote: I would like to use the :nnn named parameters but have spaces in the named parameters.

[sqlite] Enabling Shared-Cache Mode

2012-01-10 Thread smallboat
Hi, I am emailing to ask how I can know if the shared cache is acutally working and how many shared cache is created for the process. In my embedded sqlite running inside a process, we want to have all read-only db connections to share same cache to reduce memory while there are multiple

Re: [sqlite] primary key autoincrement updation problem in case refereced

2012-01-10 Thread Simon Slavin
On 11 Jan 2012, at 6:05am, Durga D wrote: > But, sqlite3_step(stmtoft1); is failing always. What might be the wrong > with this approach. What code is it reporting when it fails ? Simon. ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] primary key autoincrement updation problem in case refereced

2012-01-10 Thread jr
On 11/01/12 06:58, Durga D wrote: hh field updation in t1 table is the issue. If I do in sqlite shell, it's working fine. In C language only, I have this issue. > Any idea? > hmm, you'd need to provide (excerpts of) the actual code before I could say any more. if you can post (as plain

Re: [sqlite] primary key autoincrement updation problem in case refereced

2012-01-10 Thread Durga D
then, how to insert the record with binding and step apis in C language with second approach? hh field updation in t1 table is the issue. If I do in sqlite shell, it's working fine. In C language only, I have this issue. Any idea? On Wed, Jan 11, 2012 at 12:17 PM, jr

Re: [sqlite] primary key autoincrement updation problem in case refereced

2012-01-10 Thread jr
On 11/01/12 06:29, Durga D wrote: Deleted sqlite data base before executing first approach. and again delete sqlite database before executing second approach. ok, misread this and thought 'first approach' relevant. Issue is related to database design or insertion procedure. from what I

Re: [sqlite] primary key autoincrement updation problem in case refereced

2012-01-10 Thread Durga D
Deleted sqlite data base before executing first approach. and again delete sqlite database before executing second approach. Issue is related to database design or insertion procedure. There is no syntax problems in queries also. On Wed, Jan 11, 2012 at 11:54 AM, jr

Re: [sqlite] primary key autoincrement updation problem in case refereced

2012-01-10 Thread jr
On 11/01/12 06:05, Durga D wrote: if I understand correctly: first you created tables t1 and t2, then you say 'create if not exist' -- but they already do. instead of (re-)creating tables t1 and t2, ALTER TABLE statements can be used to modify the existing. jr.

[sqlite] Enabling Shared-Cache Mode

2012-01-10 Thread smallboat
Hi, I am emailing to ask how I can know if the shared cache is acutally working and how many shared cache is created for the process. In my embedded sqlite running inside a process, we want to have all read-only db connections to share same cache to reduce memory while there are multiple

[sqlite] primary key autoincrement updation problem in case refereced

2012-01-10 Thread Durga D
First approach: I have created database with below schema: create table if not exists t1 ( i integer primary key autoincrement, t1info text); create table if not exists t2 (ii integer primary key, t2info text, foreign key (ii) references t1 (i) ); I created two prepared statement for t1 and t2.

Re: [sqlite] Named parameters and spaces.

2012-01-10 Thread Darren Duncan
Steven Michalske wrote: On Tue, Jan 10, 2012 at 3:19 PM, Darren Duncan wrote: Steven Michalske wrote: I would like to use the :nnn named parameters but have spaces in the named parameters. It seems that ":nnn nnn", :"nn nn", or :nn\ nn are all not recognized. Is

Re: [sqlite] Named parameters and spaces.

2012-01-10 Thread Simon Slavin
On 10 Jan 2012, at 11:57pm, Steven Michalske wrote: > Some day they might have a field that is named with the underscore as > a second column; not saying it makes sense. We find all kinds on the > internet :-) Well some day they might have a field that is named with a space, too. There's

Re: [sqlite] Named parameters and spaces.

2012-01-10 Thread Steven Michalske
On Tue, Jan 10, 2012 at 2:37 PM, Pavel Ivanov wrote: >> Is there a way to use spaces in named parameters? > > No. Quick fix would be to replace all your spaces with underscores. > > > Pavel Understood, that what I did to cope, but that involves data manipulation of outside

Re: [sqlite] Named parameters and spaces.

2012-01-10 Thread Steven Michalske
On Tue, Jan 10, 2012 at 3:19 PM, Darren Duncan wrote: > Steven Michalske wrote: >> >> I would like to use the :nnn named parameters but have spaces in the >> named parameters. >> >> It seems that ":nnn nnn", :"nn nn", or :nn\ nn are all not recognized. >> >> Is there a

Re: [sqlite] Named parameters and spaces.

2012-01-10 Thread Pavel Ivanov
> Is there a way to use spaces in named parameters? No. Quick fix would be to replace all your spaces with underscores. Pavel On Tue, Jan 10, 2012 at 5:31 PM, Steven Michalske wrote: > Hello, > > I would like to use the :nnn named parameters but have spaces in the >

[sqlite] Named parameters and spaces.

2012-01-10 Thread Steven Michalske
Hello, I would like to use the :nnn named parameters but have spaces in the named parameters. It seems that ":nnn nnn", :"nn nn", or :nn\ nn are all not recognized. Is there a way to use spaces in named parameters? Steve ___ sqlite-users mailing list

Re: [sqlite] aggregate and index.

2012-01-10 Thread trash Spam
2012/1/10 Richard Hipp > On Tue, Jan 10, 2012 at 12:56 PM, trash Spam > wrote: > > SELECT (SELECT min(col3) FROM t1)+1; > Works, thank you. > > sqlite-users mailing list > > sqlite-users@sqlite.org > >

Re: [sqlite] aggregate and index.

2012-01-10 Thread Richard Hipp
On Tue, Jan 10, 2012 at 12:56 PM, trash Spam wrote: > Hi, > > Simplified example : > Table t1 > ( > col1number primary key >,col2varchar( 50 ) >,col3number > ) > > select >min( col3 ) > fro >t1 > ; > explain plan : > orderfrom

Re: [sqlite] PRAGMA index_info explanation

2012-01-10 Thread Richard Hipp
On Tue, Jan 10, 2012 at 12:30 PM, Marco Bambini wrote: > From the PRAGMA index_info documentation: > This pragma returns one row each column in the named index. The first > column of the result is the rank of the column within the index. The second > column of the result is the

[sqlite] PRAGMA index_info explanation

2012-01-10 Thread Marco Bambini
>From the PRAGMA index_info documentation: This pragma returns one row each column in the named index. The first column of the result is the rank of the column within the index. The second column of the result is the rank of the column within the table. The third column of output is the name of

Re: [sqlite] Import File with Mixed Delimiters

2012-01-10 Thread rpallotta
Thanks for the reply, but do I necessarily need to use php? I'd like the ability to do it from the SQL command window using a variation of the .import command, if possible. Kit-18 wrote: > > 2012/1/9 rpallotta : >> >> I need to import a file to a table but there are

Re: [sqlite] Problems encountered while upgrading Sqlite from 3.6.7 to 3.7.9

2012-01-10 Thread John Elrick
On Tue, Jan 10, 2012 at 10:14 AM, Richard Hipp wrote: > On Tue, Jan 10, 2012 at 10:08 AM, John Elrick wrote: > >> On Tue, Jan 10, 2012 at 8:31 AM, Richard Hipp wrote: >> > On Tue, Jan 10, 2012 at 8:14 AM, John Elrick

Re: [sqlite] Problems encountered while upgrading Sqlite from 3.6.7 to 3.7.9

2012-01-10 Thread Richard Hipp
On Tue, Jan 10, 2012 at 10:08 AM, John Elrick wrote: > On Tue, Jan 10, 2012 at 8:31 AM, Richard Hipp wrote: > > On Tue, Jan 10, 2012 at 8:14 AM, John Elrick >wrote: > > > >> I will have to get back to you on this. While

Re: [sqlite] Problems encountered while upgrading Sqlite from 3.6.7 to 3.7.9

2012-01-10 Thread John Elrick
On Tue, Jan 10, 2012 at 8:31 AM, Richard Hipp wrote: > On Tue, Jan 10, 2012 at 8:14 AM, John Elrick wrote: > >> I will have to get back to you on this.  While running tests against >> isolated queries, I noticed an unusual circumstance.  When I isolate

Re: [sqlite] Problems encountered while upgrading Sqlite from 3.6.7 to 3.7.9

2012-01-10 Thread Richard Hipp
On Tue, Jan 10, 2012 at 8:14 AM, John Elrick wrote: > I will have to get back to you on this. While running tests against > isolated queries, I noticed an unusual circumstance. When I isolate > the queries into a test program, running through our present > libraries,

Re: [sqlite] Problems encountered while upgrading Sqlite from 3.6.7 to 3.7.9

2012-01-10 Thread John Elrick
I will have to get back to you on this. While running tests against isolated queries, I noticed an unusual circumstance. When I isolate the queries into a test program, running through our present libraries, 3.7.9 is roughly 4 times faster executing the exact same queries where it is running

Re: [sqlite] insert if record not exists without primary key

2012-01-10 Thread Mohd Radzi Ibrahim
Hi, I guess, if you could sort your input data by col1 and col2; going thru the list and insert only when col1 and col2 are different from previous row, should speed up the loading too. Regards, Radzi. -Original Message- From: sqlite-users-boun...@sqlite.org

Re: [sqlite] insert if record not exists without primary key

2012-01-10 Thread Simon Slavin
On 10 Jan 2012, at 10:34am, Durga D wrote: > What about second approach. > > create table if not exists emp (id integer primary key autoincrement, col1 > text, col2 text); //without unique. > > I tried with insert or ignore into emp (col1, col2) values ('a', 'b'); > > I noticed, this is fast.

Re: [sqlite] insert if record not exists without primary key

2012-01-10 Thread Durga D
Yes. I agree. What about second approach. create table if not exists emp (id integer primary key autoincrement, col1 text, col2 text); //without unique. I tried with insert or ignore into emp (col1, col2) values ('a', 'b'); I noticed, this is fast. just to know, what might be the reason? On

Re: [sqlite] insert if record not exists without primary key

2012-01-10 Thread Simon Slavin
On 10 Jan 2012, at 8:37am, Durga D wrote: > I noticed, with first approach, huge performance hit when database grows. > for ex: database has 500,000 records. now insert 25,000 within a > transaction. It takes lot of time when compared to insert 25,000 records > with empty database. > >

Re: [sqlite] insert if record not exists without primary key

2012-01-10 Thread Durga D
Simon, Thank you. >>create table if not exists emp(id integer primary key >>autoincrement, col1 text, col2 text, unique (col1, col2)); I noticed, with first approach, huge performance hit when database grows. for ex: database has 500,000 records. now insert 25,000 within a transaction. It takes