Re: [sqlite] SQLite and Qt

2010-06-08 Thread Sam Carleton
On Tue, Jun 8, 2010 at 10:25 PM, Bill King 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

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

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. ___

[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] 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

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

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

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 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

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

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

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

2010-06-08 Thread Igor Tandetnik
Scott Frankel 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 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 wrote:

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. >> >>

[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 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,

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

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 > 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

Re: [sqlite] database corruption problem

2010-06-08 Thread Daniel Stutzbach
On Tue, Jun 8, 2010 at 10:02 AM, Simon Slavin 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 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 6:32 AM, Nick Shaw 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 >

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] 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 陶渊俊 :

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 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 wrote: >> > On Tue, Jun 08, 2010 at 06:56:33AM -0500, P Kishor scratched on the

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 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 --

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 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 >>

Re: [sqlite] database corruption problem

2010-06-08 Thread Daniel Stutzbach
On Tue, Jun 8, 2010 at 6:57 AM, Max Vlasov 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

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] 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

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

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 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] 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

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

[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] 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

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 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