Re: [sqlite] last row count 'C' API?

2010-11-15 Thread Chris Wolf
Jay A. Kreibich wrote: > On Mon, Nov 15, 2010 at 11:29:49AM -0500, Chris Wolf scratched on the wall: > >> I am looking here: >> >> http://www.sqlite.org/c3ref/funclist.html >> >> ...and I don't see an API to return the last query's row count, >> analogous to sqlite2_changes() for update >> row

Re: [sqlite] change sqlite table column type

2010-11-15 Thread Kees Nuyt
On Mon, 15 Nov 2010 14:56:47 + (UTC), Oliver Peters wrote: >Jay A. Kreibich writes: > >[...] >> >> You can also live dangerously and set "PRAGMA writable_schema=1", >> allowing you to UPDATE the sqlite_master table directly. >> >>-j >> > >is this PRAGMA documented? Can't find it h

Re: [sqlite] last row count 'C' API?

2010-11-15 Thread Jay A. Kreibich
On Mon, Nov 15, 2010 at 11:29:49AM -0500, Chris Wolf scratched on the wall: > I am looking here: > > http://www.sqlite.org/c3ref/funclist.html > > ...and I don't see an API to return the last query's row count, > analogous to sqlite2_changes() for update > row counts. Such a function does not

Re: [sqlite] change sqlite table column type

2010-11-15 Thread Jay A. Kreibich
On Mon, Nov 15, 2010 at 02:56:47PM +, Oliver Peters scratched on the wall: > Jay A. Kreibich writes: > > > You can also live dangerously and set "PRAGMA writable_schema=1", > > allowing you to UPDATE the sqlite_master table directly. > > is this PRAGMA documented? No, not on the websi

[sqlite] last row count 'C' API?

2010-11-15 Thread Chris Wolf
I am looking here: http://www.sqlite.org/c3ref/funclist.html ...and I don't see an API to return the last query's row count, analogous to sqlite2_changes() for update row counts. Or would I just count the number of invocations of productive sqlite3_step() calls (or count callback invocations via

Re: [sqlite] threads and last_insert_rowid()

2010-11-15 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 11/15/2010 04:15 AM, Ruslan Mullakhmetov wrote: > i need to get last insert id in multithreaded app. > I use C API, actually some C++ wrap over it. > if i execute query like " insert into tbl( filed ) VALUES ( 1 ); Select > last_insert_rowid() as li

Re: [sqlite] change sqlite table column type

2010-11-15 Thread Oliver Peters
Jay A. Kreibich writes: [...] > > You can also live dangerously and set "PRAGMA writable_schema=1", > allowing you to UPDATE the sqlite_master table directly. > >-j > is this PRAGMA documented? Can't find it here http://www.sqlite.org/pragma.html What do I achieve by updating sqlite_

Re: [sqlite] Strange corruptions

2010-11-15 Thread Pirmin Walthert
1) The same happens with version 3.7.3 (checked again half an hour ago) 2) I can get a dump from both databases, but the two differ: --- out1.txt +++ out2.txt @@ -1109,10 +1109,6 @@ INSERT INTO "dialplans" VALUES(27787,'044540dp4',0,0,0,''); INSERT INTO "dialplans" VALUES(27788,'044540XXX

Re: [sqlite] commit writer when other transaction is active?

2010-11-15 Thread Pavel Ivanov
> Is it correct behavior of sqlite that COMMIT will not proceed unless > no other transactions are present in the system? No, SQLite never behaves like that. Probably you executed in the second thread some SELECT query (besides INSERT) and it wasn't finished yet by the time of COMMIT. In this situ

[sqlite] [ANN] SQLiteConverter

2010-11-15 Thread Marco Bambini
Viadana, Italy - SQLabs announced SQLiteConverter, the fastest and easier way to convert your mySQL, PostgreSQL and Oracle database to sqlite. It combines a very intuitive interface with very powerful features so you can convert an existing remotely hosted database to sqlite in few time. 

Than

Re: [sqlite] change sqlite table column type

2010-11-15 Thread Jay A. Kreibich
On Mon, Nov 15, 2010 at 08:34:22AM +, Oliver Peters scratched on the wall: > lizhe writes: > > > > > > > Dear Sir: > > I have a table type is blob,I think update integer type, > > How to solve my trouble? "alter" SQL? > > [...] > > use the CLI (sqlite3) and your favourite editor: >

Re: [sqlite] uncertainty how load_extension is supposed to work

2010-11-15 Thread Chris Wolf
Richard Hipp wrote: > On Mon, Nov 15, 2010 at 7:39 AM, Chris Wolf wrote: > > >> sqlite> .load mylib >> unknown command or invalid arguments: "load". Enter ".help" for help >> >> ...and it's not listed with ".help" >> >> I have release 3.4.0 on Mac OS 10.5. >> >> >> > Bummer. I guess Le

Re: [sqlite] Strange corruptions

2010-11-15 Thread Black, Michael (IS)
Can you get a .dump from the "bad" database file? And does that match the dump from the good one? And...did you try 3.7.3 on the entire sequence? I seem to remember there were some additional checks put in since 3.6.23.1 so the old integrity_check perhaps SHOULD be failing but doesn't. And

Re: [sqlite] uncertainty how load_extension is supposed to work

2010-11-15 Thread Richard Hipp
On Mon, Nov 15, 2010 at 7:39 AM, Chris Wolf wrote: > > > sqlite> .load mylib > unknown command or invalid arguments: "load". Enter ".help" for help > > ...and it's not listed with ".help" > > I have release 3.4.0 on Mac OS 10.5. > > Bummer. I guess Leopard compiled with -DSQLITE_OMIT_LOAD_EXTEN

Re: [sqlite] uncertainty how load_extension is supposed to work

2010-11-15 Thread Chris Wolf
Richard Hipp wrote: > On Fri, Nov 12, 2010 at 12:08 PM, Chris Wolf wrote: > > >> I tried to explicitly load an extension via: >> >> sqlite> select load_extension('mylib'); >> SQL error: no such function: load_extension >> >> > > Use the ".load" command in the sqlite3.exe command-line she

[sqlite] commit writer when other transaction is active?

2010-11-15 Thread Bogdan Pilch
Hi, I observe the following behavior: Two threads processing the same transactions on a simple employee table: employee(id,name,city,salary). THREAD 1 BEGIN TRANSACTION; insert into employees values (1025,'Bush','New York',111); COMMIT TRANSACTION; THREAD 2 BEGIN TRANSACTION

Re: [sqlite] WAL and multiple writers?

2010-11-15 Thread Lynton Grice
Hi Richard, So just for my understanding, let's say I have a WAL enabled database and I have a "queue sender" application that just constantly sends and sends messages, are you saying that a "queue receiver" cannot "receive and delete the message" from the same DB until the sender releases that wh

Re: [sqlite] threads and last_insert_rowid()

2010-11-15 Thread Kees Nuyt
On Mon, 15 Nov 2010 15:15:10 +0300, Ruslan Mullakhmetov wrote: >hi. > >i need to get last insert id in multithreaded app. >I use C API, actually some C++ wrap over it. >if i execute query like " insert into tbl( filed ) VALUES ( 1 ); Select >last_insert_rowid() as li;" would be it atomic? or it

Re: [sqlite] threads and last_insert_rowid()

2010-11-15 Thread Bogdan Pilch
Hi, i think this will probably be "atomic". What i mean is the transaction will aquire EXCLUSIVE lock (because of the insert command) and it will keep this lock until commit, which takes place after the last select and last semicolon. So i believe no other threads should be able to do anything wit

[sqlite] threads and last_insert_rowid()

2010-11-15 Thread Ruslan Mullakhmetov
hi. i need to get last insert id in multithreaded app. I use C API, actually some C++ wrap over it. if i execute query like " insert into tbl( filed ) VALUES ( 1 ); Select last_insert_rowid() as li;" would be it atomic? or it anyway would suffer from threads? -- Ruslan Mullakhmetov __

Re: [sqlite] WAL and multiple writers?

2010-11-15 Thread Richard Hipp
On Mon, Nov 15, 2010 at 5:40 AM, Simon Slavin wrote: > > On 15 Nov 2010, at 10:13am, Lynton Grice wrote: > > > Any ideas on having 2 separate applications accessing the same WAL > enabled > > database? > > > > Or does the first app get an entire lock? > > All SQLite locking is locking of the enti

Re: [sqlite] Help with query

2010-11-15 Thread Jeff Archer
>From: Drake Wilson Sun, November 14, 2010 7:50:19 AM >> SELECT COUNT(Offset_Y) FROM (SELECT DISTINCT Offset_Y FROM Tiles WHERE >>PatternID >> >> = 1); >> >> Is it possible to have a single query that will generate a row for each >> PattenID, COUNT(Offset_Y) combination? > >Does SELECT Pattern

Re: [sqlite] WAL and multiple writers?

2010-11-15 Thread Simon Slavin
On 15 Nov 2010, at 10:13am, Lynton Grice wrote: > Any ideas on having 2 separate applications accessing the same WAL enabled > database? > > Or does the first app get an entire lock? All SQLite locking is locking of the entire database. SQLite does not lock rows, or ranges, or anything like t

Re: [sqlite] WAL and multiple writers?

2010-11-15 Thread Lynton Grice
Hi all, Any ideas on having 2 separate applications accessing the same WAL enabled database? Or does the first app get an entire lock? Can I perhaps set the THREAD mode to help here? I have tried: rc = sqlite3_exec(handle,"PRAGMA wal_checkpoint",0,0,0); rc = sqlite3_

[sqlite] Fwd: Database deleted from file system while other open connections exist.

2010-11-15 Thread Dennis Suehr
Simon (and others), Many thanks for your responses. This clears matters up a good bit. It just means that I will have to rethink how I implement this database 'delete' operation. Cheers, Dennis -- Forwarded message -- From: Dennis Suehr Date: 12 November 2010 16:44 Subject: Re

Re: [sqlite] change sqlite table column type

2010-11-15 Thread Oliver Peters
lizhe writes: > > > Dear Sir: > I have a table type is blob,I think update integer type, > How to solve my trouble? "alter" SQL? [...] use the CLI (sqlite3) and your favourite editor: sqlite3 yourdatabase .output file.sql .dump .q edit file.sql sqlite3 yournewdatabase < file.sql re

Re: [sqlite] Strange corruptions

2010-11-15 Thread Pirmin Walthert
I finally downgraded to sqlite 3.6.23.1. On the same system with the same database-file backups seem to work again what lets me conclude the following: - the problem is not that the source file is corrupted and "PRAGMA integrity_check" simply gives a wrong result (ok instead of showing errors)