Re: [sqlite] sqlite4 in memory databases

2012-07-16 Thread Igor Tandetnik
On 7/16/2012 8:23 PM, Carlos Milon Silva wrote: Are there any plans to sqlite4 implement these pending feature requests of sqlite3? Dumping to, and restoring from disk an sqlite memory database. http://sqlite.org/c3ref/backup_finish.html -- Igor Tandetnik

Re: [sqlite] Error: datatype mismatch (Yanhong Ye)

2012-07-16 Thread YAN HONG YE
I know the reason: if I change the file encode to latin, it will suecess import the data; but when I change the txt file to utf8 encode, It will get the error: Error: datatype mismatch I wanna know how to import utf8 encode file to my database? >Date: Mon, 16 Jul 2012 02:19:12 -0600 >From:

[sqlite] sqlite4 in memory databases

2012-07-16 Thread Carlos Milon Silva
Are there any plans to sqlite4 implement these pending feature requests of sqlite3? Dumping to, and restoring from disk an sqlite memory database. Attaching to an sqlite memory database image (for example one fetched from the network). ___

Re: [sqlite] Filling missing records

2012-07-16 Thread Petite Abeille
On Jul 16, 2012, at 10:37 PM, Luis Mochan wrote: > Suppose I have a time series in a table such as > > where ... denotes some value. There are some missing values from the > table, such as those corresponding to time=3,4,6 in my example. I need > to insert the missing rows using 0 for the

Re: [sqlite] record number after reordering

2012-07-16 Thread Keith Medcalf
> On 7/16/2012 4:19 PM, Luis Mochan wrote: > > What are the pros and cons of this approach vs. using a temporal table as > suggested by Keith? > My technique doesn't require a temp table so may be somewhat easier to > use. On the other hand, I suspect it might be much slower on a large table. >

Re: [sqlite] Table Filed Not Allowed to Be NULL?

2012-07-16 Thread Keith Medcalf
If what you really want is for all values to be -1000 in table AA when there is either no value provided or an attempt is made to insert / update with a NULL, then the following will achieve that, through triggers. sqlite> CREATE TABLE AA (column1 INTEGER, ...> column2

[sqlite] Filling missing records

2012-07-16 Thread Luis Mochan
Suppose I have a time series in a table such as time|value 0|... 1|... 2|... 5|... 7|... where ... denotes some value. There are some missing values from the table, such as those corresponding to time=3,4,6 in my example. I need to insert the missing rows using 0 for the corresponding value. Is

Re: [sqlite] record number after reordering

2012-07-16 Thread Igor Tandetnik
On 7/16/2012 4:19 PM, Luis Mochan wrote: What are the pros and cons of this approach vs. using a temporal table as suggested by Keith? My technique doesn't require a temp table so may be somewhat easier to use. On the other hand, I suspect it might be much slower on a large table. -- Igor

Re: [sqlite] record number after reordering

2012-07-16 Thread Luis Mochan
Thanks Igor, What are the pros and cons of this approach vs. using a temporal table as suggested by Keith? Best regards, Luis On Sun, Jul 15, 2012 at 06:50:44PM -0400, Igor Tandetnik wrote: > Luis Mochan wrote: > > I want to reorder a table and then group and average it's

Re: [sqlite] Table Filed Not Allowed to Be NULL?

2012-07-16 Thread Keith Medcalf
sqlite> CREATE TABLE AA (column1 INTEGER, ...> column2 INTEGER NOT NULL, ...> column3 REAL NOT NULL, ...> column4 INTEGER NOT NULL DEFAULT -1000, ...> PRIMARY KEY(column1)); sqlite> insert into aa values (1,2,3);

[sqlite] Table Filed Not Allowed to Be NULL?

2012-07-16 Thread Pam Li
Hi, In the table created below: CREATE TABLE AA (column1 INTEGER, column2 INTEGER NOT NULL, column3 REAL NOT NULL, column4 INTEGER NOT NULL DEFAULT -1000,

Re: [sqlite] Enabling shared-cache, breaking attach database

2012-07-16 Thread Keith Medcalf
You can open a :memory: database for the main database, then ATTACH your other database files. This works just fine without shared cache and does achieve your objective of always permitting access using qualified names. Be aware though that using unqualified names for a select will use the

Re: [sqlite] Updating on 32bit os slower than 64bit?

2012-07-16 Thread Jonas Malaco Filho
Could be different compilation settings for sqlite (or libs). *Jonas Malaco Filho* 2012/7/15 xp > Hi, > > I am a sqlite newbie. I would be very grateful if anyone can answer my > question or point me to the right direction. > > I have a very simple database: > >

Re: [sqlite] Enabling shared-cache, breaking attach database

2012-07-16 Thread Grace Simon Batumbya
On 7/16/2012 12:44, Richard Hipp wrote: On Mon, Jul 16, 2012 at 12:37 PM, Grace Batumbya < grace.batum...@senecacollege.ca> wrote: Hi there, With the shared-cache enabled, attaching a database to a second instance of the database connection throws an error : "database is already attached". Why

Re: [sqlite] Enabling shared-cache, breaking attach database

2012-07-16 Thread Richard Hipp
On Mon, Jul 16, 2012 at 12:37 PM, Grace Batumbya < grace.batum...@senecacollege.ca> wrote: > Hi there, > With the shared-cache enabled, attaching a database to a second instance > of the database connection throws an error : "database is already attached". > Why does this happen? is it by design

Re: [sqlite] Is it mandatory to use sqlite_encode_binary & sqlite_decode_binary to store data structures/images in blob fields

2012-07-16 Thread Richard Hipp
On Mon, Jul 16, 2012 at 10:46 AM, Tameezuddin wrote: > Hello there, > > I recently read a code project article wherein he has used above apis from > sqlite to encode and decode blob data. In my project, I have used the same > and exported the data to MS access to be used

[sqlite] Is it mandatory to use sqlite_encode_binary & sqlite_decode_binary to store data structures/images in blob fields

2012-07-16 Thread Tameezuddin
Hello there, I recently read a code project article wherein he has used above apis from sqlite to encode and decode blob data. In my project, I have used the same and exported the data to MS access to be used by a VB application. Guy who is testing the application were not able to decode the data

Re: [sqlite] set of db connections

2012-07-16 Thread Simon Slavin
On 16 Jul 2012, at 2:59pm, "Igor Tandetnik" wrote: > Durga D wrote: >> So, I can establish x connections in app initialize time in WAL mode. >> Based on request (read or write), I can pick the connection and serve. >> Allows only one write at a

Re: [sqlite] set of db connections

2012-07-16 Thread Igor Tandetnik
Durga D wrote: >So, I can establish x connections in app initialize time in WAL mode. > Based on request (read or write), I can pick the connection and serve. > Allows only one write at a time. I'm not sure what you mean by picking a connection based on a request. It's

Re: [sqlite] set of db connections

2012-07-16 Thread Durga D
Hi Michael/Igor, So, I can establish x connections in app initialize time in WAL mode. Based on request (read or write), I can pick the connection and serve. Allows only one write at a time. Is it correct? Thanks in advance. Regards, On Mon, Jul 16, 2012 at 4:43 PM, Igor Tandetnik

Re: [sqlite] set of db connections

2012-07-16 Thread Igor Tandetnik
Black, Michael (IS) wrote: > Ummmare we forgetting about WAL mode? > > http://www.sqlite.org/draft/wal.html > > "Reading and writing can proceed concurrently." > > Not that you can have multiples of each...just one of each. To be precise, with WAL you can have one

Re: [sqlite] Updating on 32bit os slower than 64bit?

2012-07-16 Thread Black, Michael (IS)
Wow...14 secs for 10 updates? That's the slowest I've ever heard by far. Is your 32-bit system using an NFS mounted /home or such? Can you run your test on /tmp instead? Michael D. Black Senior Scientist Advanced Analytics Directorate Advanced GEOINT Solutions Operating Unit Northrop

[sqlite] Updating on 32bit os slower than 64bit?

2012-07-16 Thread xp
Hi, I am a sqlite newbie. I would be very grateful if anyone can answer my question or point me to the right direction. I have a very simple database: create table epics_channel( id integer primary key, epics_pv text unique, value_type text, -- current or voltage value real default 0.0

Re: [sqlite] set of db connections

2012-07-16 Thread Black, Michael (IS)
Ummmare we forgetting about WAL mode? http://www.sqlite.org/draft/wal.html "Reading and writing can proceed concurrently." Not that you can have multiples of each...just one of each. Michael D. Black Senior Scientist Advanced Analytics Directorate Advanced GEOINT Solutions

Re: [sqlite] set of db connections

2012-07-16 Thread Durga D
Got it. Thank you so much. On Mon, Jul 16, 2012 at 3:24 PM, Simon Slavin wrote: > > On 16 Jul 2012, at 12:09pm, Durga D wrote: > > >scenario: while write request is in progress with 100K records > > insertion, new request with reading of 1

Re: [sqlite] set of db connections

2012-07-16 Thread Simon Slavin
On 16 Jul 2012, at 12:09pm, Durga D wrote: >scenario: while write request is in progress with 100K records > insertion, new request with reading of 1 records already existing > records. Here, read request should wait till write request completes. Is it > correct?

Re: [sqlite] set of db connections

2012-07-16 Thread Durga D
Hi Simon, I agree with one connection logic. scenario: while write request is in progress with 100K records insertion, new request with reading of 1 records already existing records. Here, read request should wait till write request completes. Is it correct? Thanks in advance.

Re: [sqlite] set of db connections

2012-07-16 Thread Simon Slavin
On 16 Jul 2012, at 7:50am, Durga D wrote: >I am developing readers (> 1) and writer(1) application for sqlite3 db. > >I would like to maintain set of connections in application > initialization time. whenever read request comes, serve the request from > existing

Re: [sqlite] Error: datatype mismatch

2012-07-16 Thread Keith Medcalf
sqlite> CREATE TABLE webinfo (inx INTEGER PRIMARY KEY ,website varchar(50) UNIQUE,username varchar(50),password varchar(50)); sqlite> .mode csv sqlite> .import kk.txt webinfo sqlite> select * from webinfo; 0,nytime,gf,a1..7 1,bbc,1982,tbth432 2,oknic,y...@sohu.com,bbaa1122 sqlite> Did you

Re: [sqlite] Error: datatype mismatch

2012-07-16 Thread Donald Griggs
On Mon, Jul 16, 2012 at 3:30 AM, YAN HONG YE wrote: > the table is: > CREATE TABLE webinfo (inx INTEGER PRIMARY KEY ,website varchar(50) > UNIQUE,userna > me varchar(50),password varchar(50)); > > and the txt file kk.txt is utf8: > 0,nytime,gf,a1..7 > 1,bbc,1982,tbth432 >

[sqlite] Error: datatype mismatch

2012-07-16 Thread YAN HONG YE
the table is: CREATE TABLE webinfo (inx INTEGER PRIMARY KEY ,website varchar(50) UNIQUE,userna me varchar(50),password varchar(50)); and the txt file kk.txt is utf8: 0,nytime,gf,a1..7 1,bbc,1982,tbth432 2,oknic,y...@sohu.com,bbaa1122 when I use " .import kk.txt webinfo" in cmd line I got the

[sqlite] set of db connections

2012-07-16 Thread Durga D
Hi all, I am developing readers (> 1) and writer(1) application for sqlite3 db. I would like to maintain set of connections in application initialization time. whenever read request comes, serve the request from existing connection object like pool. Here, my doubt is: if app. runs