Re: [sqlite] SQLITE : Constraint question

2009-03-15 Thread Griggs, Donald
-Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Wolfgang Enzinger Sent: Sunday, March 15, 2009 1:39 PM To: sqlite-users@sqlite.org Subject: Re: [sqlite] SQLITE : Constraint question BTW, is there a document that explains in

Re: [sqlite] designing a db to hold repeating data

2009-03-15 Thread Rich Shepard
On Sun, 15 Mar 2009, P Kishor wrote: > My only concern is query speed, data integrity (of course, that would be > helped by avoiding redundancy), and ease of querying. If I have a 300+ MB > db, saving 5 or 14 MB doesn't gain me anything. > I want to do something like this -- > > "Give me all the

Re: [sqlite] designing a db to hold repeating data

2009-03-15 Thread Rich Shepard
On Sun, 15 Mar 2009, P Kishor wrote: > CREATE TABLE met ( >met_id INTEGER PRIMARY KEY, >other met attributes, >met_grid_id INTEGER > ); Given the quantity of data you have I urge you to read Joe Celko's "SQL Programming Style" before you dig yourself into a really deep

Re: [sqlite] designing a db to hold repeating data

2009-03-15 Thread P Kishor
On Sun, Mar 15, 2009 at 8:28 PM, Jim Wilcoxson wrote: > You could eliminate met_grid_id from the cells table and replace it > with an expression cell_id/2500.  This expression will automatically > truncate, giving you met_grid_id whenever you need it.  This will save > around 5

Re: [sqlite] designing a db to hold repeating data

2009-03-15 Thread Jim Wilcoxson
You could eliminate met_grid_id from the cells table and replace it with an expression cell_id/2500. This expression will automatically truncate, giving you met_grid_id whenever you need it. This will save around 5 MB for a 1M row cell table. Also, queries in the cells table by met_grid_id, if

Re: [sqlite] designing a db to hold repeating data

2009-03-15 Thread John Machin
On 16/03/2009 11:45 AM, P Kishor wrote: > On Sun, Mar 15, 2009 at 7:29 PM, John Machin wrote: >> On 16/03/2009 11:00 AM, P Kishor wrote: >>> I have a grid of 1000 x 1000 cells with their own data as well as 20 >>> years of daily weather data (20 * 365 = 7300 rows) for each

Re: [sqlite] Creating a secondary table automatically

2009-03-15 Thread Erik Smith
Hi Chris, Thanks for your help, however, I have tried this out and the problem I have is the 'view' is only available to the current process -- I think (I am getting the error message 'unable to open database'). In my app (python), I call the various tables multiple times which is why I wanted to

Re: [sqlite] designing a db to hold repeating data

2009-03-15 Thread Alex Mandel
You should talk with Alessandro Furieri a.furi...@lqt.it who is currently working on adding Raster support to spatialite. http://www.gaia-gis.it/spatialite/ It may be more efficient to store the data separately in well used raster formats and attach them to the database as needed for queries.

[sqlite] designing a db to hold repeating data

2009-03-15 Thread P Kishor
I have a grid of 1000 x 1000 cells with their own data as well as 20 years of daily weather data (20 * 365 = 7300 rows) for each contiguous group of 50 x 50 cell. CREATE TABLE cells ( cell_id INTEGER PRIMARY KEY, other cell attributes, lat, lon, met_grid_id

Re: [sqlite] IP from number with SQL

2009-03-15 Thread John Machin
On 16/03/2009 8:48 AM, Kees Nuyt wrote: > On Sun, 15 Mar 2009 21:10:02 +0100, "Roger Andersson" > wrote: > >> Hi! >> >> The SQL below might be out there but I didn't find it >> and since there might be other that need to get >> 32-bit integer IP in a sqlite3 database to the >>

Re: [sqlite] IP from number with SQL

2009-03-15 Thread Kees Nuyt
On Sun, 15 Mar 2009 21:10:02 +0100, "Roger Andersson" wrote: >Hi! > > The SQL below might be out there but I didn't find it > and since there might be other that need to get > 32-bit integer IP in a sqlite3 database to the > a.b.c.d format using SQL > > I did get started from >

[sqlite] Cannot commit transaction - SQL statements in progress

2009-03-15 Thread Bejhan Jetha
I am using JDBC with SQLite and am running into a problem where I get the exception: Cannot commit transaction - SQL statements in progress I searched the net and posted in another forum but I can't seem to find a solution. Once I run the method below called AddMealPlan I cannot execute

[sqlite] IP from number with SQL

2009-03-15 Thread Roger Andersson
Hi! The SQL below might be out there but I didn't find it and since there might be other that need to get 32-bit integer IP in a sqlite3 database to the a.b.c.d format using SQL I did get started from http://acidlab.sourceforge.net/acid_faq.html#faq_e1 and for me what's below does the trick in

Re: [sqlite] LEFT INNER JOIN a second database

2009-03-15 Thread P Kishor
On Sun, Mar 15, 2009 at 2:36 PM, Derek Developer wrote: > yes the example works as expected. This is the first step in debugging this > problem which could of course turn out to be my code. But since you were > baying for something to execute... I should also say that

[sqlite] LEFT INNER JOIN a second database

2009-03-15 Thread Derek Developer
yes the example works as expected. This is the first step in debugging this problem which could of course turn out to be my code. But since you were baying for something to execute... I should also say that it is interesting to note the "vigor" with which some of you are 'helping'! The next

Re: [sqlite] SQLITE : Constraint question

2009-03-15 Thread Wolfgang Enzinger
> Date: Wed, 11 Mar 2009 19:10:26 -0600 > From: Dennis Cote > Subject: Re: [sqlite] SQLITE : Constraint question [...] > However, you can explicitly add the equivalent constraints to your table > definitions if you really want them. For example: > > create table

Re: [sqlite] table metadata

2009-03-15 Thread P Kishor
On Sun, Mar 15, 2009 at 11:56 AM, P Kishor wrote: > I am designing a database for carbon modeling. Many of the parameters > to be stored in the db have very long names... it is kinda > inconvenient to have column names such as >

[sqlite] table metadata

2009-03-15 Thread P Kishor
I am designing a database for carbon modeling. Many of the parameters to be stored in the db have very long names... it is kinda inconvenient to have column names such as 'new_live_wood_Carbon_to_new_total_wood_Carbon', but I hate column names such as 'nlivwdc2ntotwdc'. I may as well just call