Re: [sqlite] Is it possible to generate tf-idf matrix from the FTS3 table?

2010-06-08 Thread Scott Hess
On Sat, Jun 5, 2010 at 10:29 AM, Han-Teng Liao hant...@gmail.com wrote:    I intend to use my existing datasets stored in sqlite3 database for some linguistic analysis for Chinese language. After I have successfully installed and run the FTS3 Extension and ICU Extension, I am curious whether

Re: [sqlite] last_insert_rowid INTEGER PRIMARY KEY columns

2010-06-08 Thread Andy Gibbs
[...] does db last_insert_rowid reliably return the_key of the most recently inserted database row, so that the returned value may safely (across vacuums etc) be used as a foreign reference to t's the_key column? Yes. Actually there *is* a caveat, which is that if the insert does not

[sqlite] database corruption problem

2010-06-08 Thread Daniel Stutzbach
I'm the author of a small Windows application that embeds SQLite. I'm currently using version 3.5.9 with PRAGMA locking_mode = EXCLUSIVE and PRAGMA journal_mode = TRUNCATE. I just received a crash report from a user with the dreaded error: database disk image is malformed. My application is

Re: [sqlite] Oracle connection

2010-06-08 Thread Gary_Gabriel
Simon Hax wrote: for clearification: the roots of the question: business needs; our client has a big Oracle infrastructure. Now they want, in relation to their infrastructure a litte App based on SQlite. as I mentioned earlier: to copy data from an Oracle DB to another Oracle DB there is

Re: [sqlite] sql api for ufs

2010-06-08 Thread bch
On Mon, Jun 07, 2010 at 12:08:40PM -0700, George Georgalis wrote: On Mon 07 Jun 2010 at 05:07:43 PM +0200, Kees Nuyt wrote: That could be implemented as an appication with a set of virtual tables, backed by the readdir() and stat() system calls. I haven't heard of any implementation,

Re: [sqlite] database corruption problem

2010-06-08 Thread Nick Shaw
Daniel Stutzbach wrote: Are there any other known ways that the database might become corrupt? My list of possible causes would be: 1) File/Disk corruption by the OS. On Windows, this can happen if the system suffers a power loss in the middle of a write, most noticeable when you're writing a

Re: [sqlite] returning a larger snippet in FTS3 match

2010-06-08 Thread P Kishor
Hi all, re-asking this in case it missed some of the keener eyes -- I am using the Snippet() function to return a snippet of text from my FTS3 table showing the MATCH context. I would like to make the returned snippet longer. Is that possible? On Sun, Jun 6, 2010 at 10:36 AM, P Kishor

Re: [sqlite] database corruption problem

2010-06-08 Thread Max Vlasov
On Mon, Jun 7, 2010 at 7:31 PM, Daniel Stutzbach dan...@stutzbachenterprises.com wrote: I'm the author of a small Windows application that embeds SQLite. I'm currently using version 3.5.9 with PRAGMA locking_mode = EXCLUSIVE and PRAGMA journal_mode = TRUNCATE. I just received a crash report

Re: [sqlite] returning a larger snippet in FTS3 match

2010-06-08 Thread Jay A. Kreibich
On Tue, Jun 08, 2010 at 06:56:33AM -0500, P Kishor scratched on the wall: Hi all, re-asking this in case it missed some of the keener eyes -- I am using the Snippet() function to return a snippet of text from my FTS3 table showing the MATCH context. I would like to make the returned snippet

Re: [sqlite] database corruption problem

2010-06-08 Thread Jay A. Kreibich
On Tue, Jun 08, 2010 at 12:32:22PM +0100, Nick Shaw scratched on the wall: Daniel Stutzbach wrote: Are there any other known ways that the database might become corrupt? My list of possible causes would be: 1) File/Disk corruption by the OS. On Windows, this can happen if the system

Re: [sqlite] database corruption problem

2010-06-08 Thread Daniel Stutzbach
On Tue, Jun 8, 2010 at 6:57 AM, Max Vlasov max.vla...@gmail.com wrote: You didn't mention your language/development tools. It would help also. The application is written primarily in Python 2.6, using the sqlalchemy package to talk to the database. Parts of the program are written in C and

Re: [sqlite] returning a larger snippet in FTS3 match

2010-06-08 Thread P Kishor
On Tue, Jun 8, 2010 at 8:29 AM, Jay A. Kreibich j...@kreibi.ch wrote: On Tue, Jun 08, 2010 at 06:56:33AM -0500, P Kishor scratched on the wall: Hi all, re-asking this in case it missed some of the keener eyes -- I am using the Snippet() function to return a snippet of text from my FTS3 table

Re: [sqlite] returning a larger snippet in FTS3 match

2010-06-08 Thread Jay A. Kreibich
On Tue, Jun 08, 2010 at 08:49:22AM -0500, P Kishor scratched on the wall: On Tue, Jun 8, 2010 at 8:29 AM, Jay A. Kreibich j...@kreibi.ch wrote: On Tue, Jun 08, 2010 at 06:56:33AM -0500, P Kishor scratched on the wall: Hi all, re-asking this in case it missed some of the keener eyes -- I am

Re: [sqlite] returning a larger snippet in FTS3 match

2010-06-08 Thread P Kishor
On Tue, Jun 8, 2010 at 9:14 AM, Jay A. Kreibich j...@kreibi.ch wrote: On Tue, Jun 08, 2010 at 08:49:22AM -0500, P Kishor scratched on the wall: On Tue, Jun 8, 2010 at 8:29 AM, Jay A. Kreibich j...@kreibi.ch wrote: On Tue, Jun 08, 2010 at 06:56:33AM -0500, P Kishor scratched on the wall: Hi

Re: [sqlite] 3.6.23 segmentation fault with trigger and DEFAULT VALUES

2010-06-08 Thread Pavel Ivanov
Even though it had been fixed in 3.6.23, why I could reproduce it? Actually it's found in version 3.6.23 and fixed in the trunk of SQLite repository but SQLite didn't have a release since then. So this bug will be fixed in the next version. Pavel 2010/6/8 陶渊俊 yuanjun@dragonsoftit.com:

Re: [sqlite] database corruption problem

2010-06-08 Thread Simon Slavin
On 8 Jun 2010, at 3:39pm, Daniel Stutzbach wrote: After talking with my user a bit more, he reported that he had a power outage around a week prior to the error. Is it possible that some part of the database became corrupt in a way that didn't immediately cause any problems? Yes. It's

Re: [sqlite] database corruption problem

2010-06-08 Thread Daniel Stutzbach
On Tue, Jun 8, 2010 at 6:32 AM, Nick Shaw nick.s...@citysync.co.uk wrote: 1) File/Disk corruption by the OS. On Windows, this can happen if the system suffers a power loss in the middle of a write, most noticeable when you're writing a large amount of data to a file (I realise it shouldn't

Re: [sqlite] database corruption problem

2010-06-08 Thread Pavel Ivanov
Yes.  It's quite possible to have corruption which shows only when you hit a particular row while using a particular index.  The corruption can hide in the file while you carry on adding rows or searching using other indices and come to light only under some weird circumstance in the

Re: [sqlite] database corruption problem

2010-06-08 Thread Daniel Stutzbach
On Tue, Jun 8, 2010 at 10:02 AM, Simon Slavin slav...@bigfraud.org wrote: I'm not sure whether a power-cut at a particularly bad time could cause something like this. The journaling mechanism built into SQLite should be avoiding it, but your combination of PRAGMAs might be defeating the

Re: [sqlite] database corruption problem

2010-06-08 Thread Dan Kennedy
On Jun 8, 2010, at 10:54 PM, Daniel Stutzbach wrote: On Tue, Jun 8, 2010 at 10:02 AM, Simon Slavin slav...@bigfraud.org wrote: I'm not sure whether a power-cut at a particularly bad time could cause something like this. The journaling mechanism built into SQLite should be avoiding

Re: [sqlite] database corruption problem

2010-06-08 Thread Simon Slavin
On 8 Jun 2010, at 5:25pm, Dan Kennedy wrote: Those pragmas should not cause a problem. Simon's referring to PRAGMA synchronous. The docs for which explain the risks assumed by changing the default setting. http://www.sqlite.org/pragma.html#pragma_synchronous You're both right. I didn't

Re: [sqlite] database corruption problem

2010-06-08 Thread Dave Segleau
On 6/8/2010 9:25 AM, Dan Kennedy wrote: Those pragmas should not cause a problem. Simon's referring to PRAGMA synchronous. The docs for which explain the risks assumed by changing the default setting. http://www.sqlite.org/pragma.html#pragma_synchronous As Dan said, PRAGMA

[sqlite] copy data from one db to another

2010-06-08 Thread Scott Frankel
Hi all, 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 brute force way would be to perform selects on the source db, then for each row, perform an insert into the destination db. Is there a more

Re: [sqlite] database corruption problem

2010-06-08 Thread Dan Kennedy
On Jun 9, 2010, at 12:51 AM, Dave Segleau wrote: On 6/8/2010 9:25 AM, Dan Kennedy wrote: Those pragmas should not cause a problem. Simon's referring to PRAGMA synchronous. The docs for which explain the risks assumed by changing the default setting.

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

2010-06-08 Thread Adam DeVita
start by doing an open db1 (as main) then attach path to db2 as 'db2' insert into main.table_one_name select * from db2.table_one_name ; This selects all records from db2 and puts them into db1 in one statement. Adam On Tue, Jun 8, 2010 at 3:02 PM, Scott Frankel fran...@circlesfx.com wrote:

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

2010-06-08 Thread Igor Tandetnik
Scott Frankel fran...@circlesfx.com 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 Why not just copy the whole file over? -- Igor Tandetnik ___

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

2010-06-08 Thread Jean-Christophe Deschamps
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 brute force way would be to perform selects on the source db, then for each row, perform an insert into the destination db. Is there a more efficient way?

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

2010-06-08 Thread Scott Frankel
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 brute force way would be to perform selects on the source db, then for each row,

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

2010-06-08 Thread Scott Frankel
On Jun 8, 2010, at 12:07 PM, Adam DeVita wrote: start by doing an open db1 (as main) then attach path to db2 as 'db2' insert into main.table_one_name select * from db2.table_one_name ; This selects all records from db2 and puts them into db1 in one statement. I've been reading about

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

2010-06-08 Thread Adam DeVita
The db that you open your initial connection to is called main by default. I haven't had the occasion to use a temp or memory db so I can't comment. The attach statement works as normal SQL. attach 'path to your db' as 'some_alias_name' like attach 'c:\temp dir\db2.db' as 'db2' Suppose both

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

2010-06-08 Thread Simon Slavin
On 8 Jun 2010, at 9:02pm, 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 brute force way would be to perform

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

2010-06-08 Thread Scott Frankel
On Jun 8, 2010, at 2:28 PM, Simon Slavin wrote: On 8 Jun 2010, at 9:02pm, 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

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

2010-06-08 Thread Simon Slavin
On 8 Jun 2010, at 10:47pm, Scott Frankel wrote: On Jun 8, 2010, at 2:28 PM, Simon Slavin wrote: Either write a program to read record-by-record and write record-by- record, or use PostgreSQL functions to write to SQL commands then execute those commands to create a new SQLite database.

[sqlite] SQLite and Qt

2010-06-08 Thread Sam Carleton
I have been using SQLite for a few years now in an Apache server module and it works great for me. The system is expanding, I am working on a Qt based GUI program that needs to access the SQLite database. (The Qt program is only going to run on the same machine as the Apache Server.) If I am

Re: [sqlite] 3.6.23 segmentation fault with trigger and DEFAULT VALUES

2010-06-08 Thread 陶渊俊
Actually it's found in version 3.6.23 and fixed in the trunk of SQLite repository but SQLite didn't have a release since then. So this bug will be fixed in the next version. * Pavel I got it. Thank you very much indeed. ___

Re: [sqlite] SQLite and Qt

2010-06-08 Thread Bill King
On 06/09/2010 11:52 AM, ext Sam Carleton wrote: I have been using SQLite for a few years now in an Apache server module and it works great for me. The system is expanding, I am working on a Qt based GUI program that needs to access the SQLite database. (The Qt program is only going to run on

Re: [sqlite] SQLite and Qt

2010-06-08 Thread Sam Carleton
On Tue, Jun 8, 2010 at 10:25 PM, Bill King bill.k...@nokia.com wrote: 1. How do I control the version of SQLite used with Qt? ./configure -system-sqlite will use the sqlite compiled for your system. No, not how do I compile SQLite into Qt, I have done that. I want to control the