Re: [sqlite] copy data from one db to another

2010-06-09 Thread Vivien Malerba
On 8 June 2010 22:02, Scott Frankel wrote: > > On Jun 8, 2010, at 12:51 PM, Jean-Christophe Deschamps wrote: > >> >>> What's the best way to copy data from one db to another? >>> >>> Given 2 databases with identical schemas, one full of data and the >>> other empty, the

Re: [sqlite] SQLite and Qt

2010-06-09 Thread Sylvain Pointeau
build your qt sqlite as a plugin then recompile this plugin with the version you want. http://doc.trolltech.com/4.6/sql-driver.html#qsqlite-for-sqlite-version-3-and-above best regards, Sylvain On Wed, Jun 9,

[sqlite] Date format definition on bulk csv insert

2010-06-09 Thread twoblink
Hi, I have a few gigs of csv information I need to import; using SqliteMaestro works but imports about 1000 rows / sec and I have a few hundred million rows, so that's not a real solution. I did the .mode csv, .import from the sqlite3 program, and everything imported fine except the datetime

[sqlite] Use sqlite on flash file system like yaffs

2010-06-09 Thread Wei Kai
hi list, I have a problem here. As we know sqlite creates a journal every time a write transaction happens. On a flash file system, when a write to database failed because of the lack of enough disk space, the journal file just remain there, and the next time when user try to access the database,

Re: [sqlite] Date format definition on bulk csv insert

2010-06-09 Thread Pavel Ivanov
> I would like to tell sqlite that this is in > .mm.dd hh:mm:ss.sss > > How can I define this in sqlite's program so it imports the datetime > correctly? SQLite doesn't have datetime type and thus doesn't have any datetime format to use in the import. Your datetime is imported as simple

Re: [sqlite] Concurrency for in-memory scenarios

2010-06-09 Thread Navaneeth Sen B
Hi Pavel, Could you please explain what you meant in this line? > Of course I don't consider option of concurrency from > different processes. Thanks & Regards, Sen On 4/6/2010 8:33 PM, Pavel Ivanov wrote: >> Can anyone confirm whether concurrent >> access to an in-memory database is supported?

[sqlite] Storing AVCHD files

2010-06-09 Thread Navaneeth Sen B
Hi All, I would like to know how i can store an AVCHD file(It has a folder structure) having size greater than 4GB. The reason behind this question is like, from the documentation i found that the maximum supported BLOB size is 1GB. So i assume i will have to split my AVCHD file into small

Re: [sqlite] Concurrency for in-memory scenarios

2010-06-09 Thread Pavel Ivanov
> Could you please explain what you meant in this line? >> Of course I don't consider option of concurrency from >> different processes. I guess I meant that my above words are related to the case when you access the database from the same process, and if one talks about different processes it's

Re: [sqlite] Storing AVCHD files

2010-06-09 Thread Pavel Ivanov
> So i assume i will have to > split my AVCHD file into small files. Ok.. i am fine with that, but how > will i maintain the folder structure of these split files.? If maximum supported blob size is 1Gb and you want to store a bigger data chunk then you split your data into several *blobs* and

Re: [sqlite] Storing AVCHD files

2010-06-09 Thread Jean-Denis Muys
On 6/9/10 13:26 , "Pavel Ivanov" wrote: >> So i assume i will have to >> split my AVCHD file into small files. Ok.. i am fine with that, but how >> will i maintain the folder structure of these split files.? > > If maximum supported blob size is 1Gb and you want to store a

Re: [sqlite] Storing AVCHD files

2010-06-09 Thread Navaneeth Sen B
Thanks Simon. Hi Jean, I dint understand the below given statement. Could you please explain this to me? > possibility for the user to tamper with the files behind your > application's back (though if you are using SQLite, s/he can do so in the > monolithic case as well). > > Thanks &

Re: [sqlite] Storing AVCHD files

2010-06-09 Thread Jean-Denis Muys
On 6/9/10 13:55 , "Navaneeth Sen B" wrote: > Thanks Simon. > > Hi Jean, > I dint understand the below given statement. Could you please explain > this to me? >> possibility for the user to tamper with the files behind your >> application's back (though if you are

Re: [sqlite] Storing AVCHD files

2010-06-09 Thread Navaneeth Sen B
Thanks Jean, That was a really great explanation.. Regards, Sen / /// On 6/9/2010 5:39 PM, Jean-Denis Muys wrote: > On 6/9/10 13:55 , "Navaneeth Sen B" wrote: > > >> Thanks Simon. >> >> Hi Jean, >> I dint understand the below given statement. Could you please

Re: [sqlite] Date format definition on bulk csv insert

2010-06-09 Thread Simon Slavin
On 9 Jun 2010, at 9:34am, twoblink wrote: > in the csv; the field is defined like: > > 2010.03.31 16:01:24.284 For a datetime field. SQLite does not have any such field type. > I would like to tell sqlite that this is in > .mm.dd hh:mm:ss.sss > > How can I define this in sqlite's

Re: [sqlite] Storing AVCHD files

2010-06-09 Thread Simon Slavin
On 9 Jun 2010, at 12:18pm, Navaneeth Sen B wrote: > I would like to know how i can store an AVCHD file(It has a folder > structure) having size greater than 4GB. It is unlikely that whatever filesystem you're using will allow any file to be this big. Therefore you cannot have a database file

Re: [sqlite] Use sqlite on flash file system like yaffs

2010-06-09 Thread Simon Slavin
On 9 Jun 2010, at 9:48am, Wei Kai wrote: > I have a problem here. As we know sqlite creates a journal every time a > write transaction happens. On a flash file system, when a write to database > failed because of the lack of enough disk spac Sorry, but if your program crashes because you ran

[sqlite] database development - correct way?

2010-06-09 Thread Oliver Peters
Hello, despite it's just a question about construction I hope somebody is willing to push me into the right direction if necessary. my simplified case -- I've the 3 tables customer, article and order my thoughts about the table customer: the customernumber can be from 3

Re: [sqlite] Storing AVCHD files

2010-06-09 Thread Jean-Denis Muys
On 6/9/10 14:37 , "Simon Slavin" wrote: > > On 9 Jun 2010, at 12:18pm, Navaneeth Sen B wrote: > >> I would like to know how i can store an AVCHD file(It has a folder >> structure) having size greater than 4GB. > > It is unlikely that whatever filesystem you're using

[sqlite] [BUG] Adding an index changes query result

2010-06-09 Thread Tomash Brechko
Hello, With SQLite 3.6.23.1 I see the following: $ ./sqlite3 /tmp/a.sqlite SQLite version 3.6.23.1 Enter ".help" for instructions Enter SQL statements terminated with a ";" sqlite> CREATE TABLE t (c1 INTEGER, c2 INTEGER); sqlite> INSERT INTO t (c1, c2) VALUES (5, 5); sqlite> SELECT

Re: [sqlite] Storing AVCHD files

2010-06-09 Thread P Kishor
On Wed, Jun 9, 2010 at 8:49 AM, Jean-Denis Muys wrote: > > On 6/9/10 14:37 , "Simon Slavin" wrote: > >> >> On 9 Jun 2010, at 12:18pm, Navaneeth Sen B wrote: >> >>> I would like to know how i can store an AVCHD file(It has a folder >>> structure) having

Re: [sqlite] [BUG] Adding an index changes query result

2010-06-09 Thread Black, Michael (IS)
This is a bit weird...it appears it's just the = operator causing this... sqlite> select * from t where c1>=5 and c2>0 and c2<='2'; sqlite> select * from t where c1<=5 and c2>0 and c2<='2'; sqlite> select * from t where c1=5 and c2>0 and c2<='2'; 5|5 sqlite> drop index t_c1_c2; sqlite> select *

Re: [sqlite] [BUG] Adding an index changes query result

2010-06-09 Thread Eduardo Pérez Ureta
2010-06-09 Tomash Brechko : > With SQLite 3.6.23.1 I see the following: > >  $ ./sqlite3 /tmp/a.sqlite >  SQLite version 3.6.23.1 >  Enter ".help" for instructions >  Enter SQL statements terminated with a ";" >  sqlite> CREATE TABLE t (c1 INTEGER, c2 INTEGER); >  sqlite>

Re: [sqlite] [BUG] Adding an index changes query result

2010-06-09 Thread Pavel Ivanov
Eduardo, You should never check correctness of what SQLite is doing in postgresql or mysql. They are different database engines with different principles. SQLite does exactly the right thing in this case and exactly how it's documented. (I don't mean dependence of query result on index existence

Re: [sqlite] database development - correct way?

2010-06-09 Thread Adam DeVita
I wouldn't advise using an SQL keyword as a table name: "Order" I presume that your order collection table example is shorter than the real one for the sake of the example? One often sees a date or time of some sort associated with an order so that one can create reports based on dates. (How

Re: [sqlite] [BUG] Adding an index changes query result

2010-06-09 Thread Black, Michael (IS)
Pavel -- did you miss my test here? sqlite> select * from t where c1>=5 and c2>0 and c2<='2'; sqlite> select * from t where c1<=5 and c2>0 and c2<='2'; sqlite> select * from t where c1=5 and c2>0 and c2<='2'; 5|5 sqlite> drop index t_c1_c2; sqlite> select * from t where c1<=5 and c2>0 and

Re: [sqlite] [BUG] Adding an index changes query result

2010-06-09 Thread Tomash Brechko
2010/6/9 Pavel Ivanov > You can see that these 2 cases compare the same way. They both show > that string is always greater than number and thus '11' > 2 and '2' > > 11. And no affinity rules are applicable here because you use > constants which don't have any affinity.

Re: [sqlite] Use sqlite on flash file system like yaffs

2010-06-09 Thread Jay A. Kreibich
On Wed, Jun 09, 2010 at 01:40:30PM +0100, Simon Slavin scratched on the wall: > > On 9 Jun 2010, at 9:48am, Wei Kai wrote: > > > I have a problem here. As we know sqlite creates a journal every time a > > write transaction happens. On a flash file system, when a write to database > > failed

Re: [sqlite] [BUG] Adding an index changes query result

2010-06-09 Thread Pavel Ivanov
> Perhaps this is the way it was supposed to work.  But presence of index > does affect something, so I assumed it somehow messes affinity (what else?). Comparison of numbers and strings without affinities is supposed to work this way, yes. In this case though I think you're right - comparison on

Re: [sqlite] [BUG] Adding an index changes query result

2010-06-09 Thread Richard Hipp
On Wed, Jun 9, 2010 at 11:29 AM, Pavel Ivanov wrote: > > Perhaps this is the way it was supposed to work. But presence of index > > does affect something, so I assumed it somehow messes affinity (what > else?). > > Comparison of numbers and strings without affinities is

Re: [sqlite] Use sqlite on flash file system like yaffs

2010-06-09 Thread Richard Hipp
On Wed, Jun 9, 2010 at 11:26 AM, Jay A. Kreibich wrote: > On Wed, Jun 09, 2010 at 01:40:30PM +0100, Simon Slavin scratched on the > wall: > > > > On 9 Jun 2010, at 9:48am, Wei Kai wrote: > > > > > I have a problem here. As we know sqlite creates a journal every time a > > > write

[sqlite] Minor WAL document typo

2010-06-09 Thread Jim Morris
http://www.sqlite.org/draft/wal.html 'a' should be 'as' in the text "located in the same directory or folder a the original database file" Should be "located in the same directory or folder as the original database file" ___ sqlite-users mailing list

Re: [sqlite] copy data from one db to another

2010-06-09 Thread Scott Frankel
On Jun 9, 2010, at 12:22 AM, Vivien Malerba wrote: > On 8 June 2010 22:02, Scott Frankel wrote: >> >> On Jun 8, 2010, at 12:51 PM, Jean-Christophe Deschamps wrote: >> >>> What's the best way to copy data from one db to another? Given 2 databases with

Re: [sqlite] database development - correct way?

2010-06-09 Thread Tim Romano
Placing a unique composite index on (customer, article) in the Orders table prevents recurring purchases of the same article by the same customer. Acme might buy a widget in June and then place another order for a widget in September, but the order would be rejected as a duplicate. Typically,

Re: [sqlite] database development - correct way?

2010-06-09 Thread Oliver Peters
Adam DeVita writes: > > I wouldn't advise using an SQL keyword as a table name: "Order" > > I presume that your order collection table example is shorter than the real > one for the sake of the example? [...] yes - and the content has nothing to do with my real tables. The

Re: [sqlite] database development - correct way?

2010-06-09 Thread Rich Shepard
On Wed, 9 Jun 2010, Tim Romano wrote: > Typically, Orders are divided into OrderHeader and OrderDetail tables: > > OrderHeader > id integer primary key > orderdate > customerid > > OrderDetail > id > orderid references OrderHeader(id) > articleid references article(id) > quantity int > > And you

Re: [sqlite] copy data from one db to another

2010-06-09 Thread Black, Michael (IS)
Assuming postgres can load SQL from a file you should be able to use named pipes on all 3. Here's windows: sqlite> create table t (i integer); sqlite> insert into t values(1); sqlite> insert into t values(2); sqlite> .output \\.\pipe\foo sqlite> .dump 2nd window: sqlite> .read \\.\pipe\foo

Re: [sqlite] database development - correct way?

2010-06-09 Thread Rich Shepard
On Wed, 9 Jun 2010, Oliver Peters wrote: > So I assume that it is not(!) a mistake not(!) to use a composite PK in my > table "customer" (customernumber,customerorigin) and to refer to it from > the table "order" where I had to use these fields as a composite FK? Oliver, Too many negatives

Re: [sqlite] database development - correct way?

2010-06-09 Thread Oliver Peters
Rich Shepard writes: > > On Wed, 9 Jun 2010, Oliver Peters wrote: > > > So I assume that it is not(!) a mistake not(!) to use a composite PK in my > > table "customer" (customernumber,customerorigin) and to refer to it from > > the table "order" where I had to use these fields as

Re: [sqlite] copy data from one db to another

2010-06-09 Thread Vivien Malerba
On 9 June 2010 18:58, Scott Frankel wrote: > > On Jun 9, 2010, at 12:22 AM, Vivien Malerba wrote: > >> On 8 June 2010 22:02, Scott Frankel wrote: >>> >>> On Jun 8, 2010, at 12:51 PM, Jean-Christophe Deschamps wrote: >>> > What's the best way

Re: [sqlite] copy data from one db to another

2010-06-09 Thread Rich Shepard
On Wed, 9 Jun 2010, Vivien Malerba wrote: >> I forgot to mention, the source is a PostgreSQL db, not SQLite, so >> there's no source file to copy.  Though a backup might be >> interesting ... > You can use Libgda's gda-sql tool in which you can: > * open a connection to the PostgreSQL db (for

Re: [sqlite] copy data from one db to another

2010-06-09 Thread Vivien Malerba
On 9 June 2010 20:44, Rich Shepard wrote: > On Wed, 9 Jun 2010, Vivien Malerba wrote: > >>> I forgot to mention, the source is a PostgreSQL db, not SQLite, so >>> there's no source file to copy.  Though a backup might be >>> interesting ... > >> You can use Libgda's

Re: [sqlite] database development - correct way?

2010-06-09 Thread Tim Romano
Oliver, Your first solution CREATE TABLE customer( idINTEGER PRIMARY KEY AUTOINCREMENT, customernumberINTEGER, customeroriginINTEGER, name TEXT, UNIQUE(customernumber,customerorigin) ); is the better of the two because it simplifies foreign keys:

[sqlite] compiling in foreign key support

2010-06-09 Thread Sam Carleton
>From looking at the compile page (http://www.sqlite.org/compile.html), I am not seeing any compile options to turn on foreign key support. Was it left out of the documentation or does the feature really not exist yet? If the feature isn't there yet, it would be really nice, there will never be

Re: [sqlite] compiling in foreign key support

2010-06-09 Thread Jay A. Kreibich
On Wed, Jun 09, 2010 at 03:15:32PM -0400, Sam Carleton scratched on the wall: > >From looking at the compile page (http://www.sqlite.org/compile.html), I am > not seeing any compile options to turn on foreign key support. Was it left > out of the documentation or does the feature really not exist

Re: [sqlite] [BUG] Adding an index changes query result

2010-06-09 Thread Israel Lins Albuquerque
I make the possible soluction I did't know if this is the best but is this: // Index: D:/FS_trunk/devpalm_01/poli_sqlite_lib/src/expr.c ===

Re: [sqlite] [BUG] Adding an index changes query result

2010-06-09 Thread Israel Lins Albuquerque
How this solve the bug? The function binaryCompareP5 is called (in query compile time) to know what affinity will be used to make the comparition between the expression "(c2 <= '2')", but that function are returning when index not exists SQLITE_AFF_INTEGER and not SQLITE_AFF_NONE because

Re: [sqlite] [BUG] Adding an index changes query result

2010-06-09 Thread Richard Hipp
On Wed, Jun 9, 2010 at 3:34 PM, Israel Lins Albuquerque < israel...@polibrasnet.com.br> wrote: > > > I make the possible soluction I did't know if this is the best but is this: > The correct fix is checked in here: http://www.sqlite.org/src/vinfo/6eb058dda8 -- - D. Richard

Re: [sqlite] Use sqlite on flash file system like yaffs

2010-06-09 Thread Wei Kai
Richard, thank you for pointing to WAL. It seems interesting. On Wed, Jun 9, 2010 at 11:58 PM, Richard Hipp wrote: > On Wed, Jun 9, 2010 at 11:26 AM, Jay A. Kreibich wrote: > > > On Wed, Jun 09, 2010 at 01:40:30PM +0100, Simon Slavin scratched on the > > wall:

[sqlite] how to install sqlite3 in windows+python2.5

2010-06-09 Thread zeal
hi, i installed python2.5, it seems wrapped sqlite3, but the version is 2.3.2. sqlite3 2.3.2 could not use function group_concat, so i want to use latest version of sqlite3. i know how to install sqlite3 in linux/unix, but i have no idea install sqlite3 on windows. i have

Re: [sqlite] how to install sqlite3 in windows+python2.5

2010-06-09 Thread zeal
google told me, this is the real version, but it still old, i need 3.6.23 please help me. >>> import sqlite3 >>> sqlite3.sqlite_version '3.3.4' -- From: "zeal" Sent: Thursday, June 10, 2010 11:54 AM To: "General Discussion of

Re: [sqlite] how to install sqlite3 in windows+python2.5

2010-06-09 Thread jerome.mag...@bluewin.ch
Download the zip archive containing "sqlite3.dll" for latest sqlite version. Then replace the existing library inside python 2.5 install. directory with the one downloaded. Message d'origine De: zealx...@hotmail.com Date: 10.06.2010 06:04 À: "General Discussion of SQLite