Re: [sqlite] debugging sqlite with gdb

2009-08-17 Thread Mohammad Reaz Uddin
Thanks everybody. On Mon, Aug 17, 2009 at 5:22 AM, Simon Slavin wrote: > > On 17 Aug 2009, at 12:46am, Miroslav Zagorac wrote: > > > Mohammad Reaz Uddin wrote: > >> I downloaded 'sqlite-amalgamation-3.6.16.tar.gz' and used makefile to > >> compile it. > > > > sqlite

Re: [sqlite] Problems with max(datestamp) in subquery

2009-08-17 Thread David Bicking
On Mon, 2009-08-17 at 15:05 -0700, Leo Freitag wrote: > David Bicking-2 wrote: > > > > As written, you were selecting any record with the correct date > > regardless of Ensemble or Steuck. > > > > David > The following seem to work: > > SELECT * FROM tblZO_Haupt AS hpt > WHERE >

[sqlite] What does SQLITE_IOERR_TRUNCATE mean, exactly?

2009-08-17 Thread John Belli
I have a broken database file, with a journal. It is opened read-only (via sqlite3_open_v2()). The statement "PRAGMA user version" is prepared successfully. When sqlite3_step() is called, the return code is SQLITE_IOERR. The extended code is SQLITE_IOERR_TRUNCATE. What exactly does this mean?

Re: [sqlite] Functions to convert dates with non-English month name?

2009-08-17 Thread Gilles Ganault
On Mon, 17 Aug 2009 07:44:15 -0400, "Igor Tandetnik" wrote: >update membres set dateinscription= >substr(dateinscription, -4) || '-' || >(case substr(dateinscription, 4, length(dateinscription) - 8) > when 'January' then '01' when 'February' then '02' ... >

Re: [sqlite] [Duplicates] How to keep only one row?

2009-08-17 Thread Gilles Ganault
On Mon, 17 Aug 2009 13:05:53 +0200, Martin Engelschalk wrote: >If you are looking for a delete - command, then you have to decide which >of the duplicate rows you want to keep. Are they all the same even in >the other fields? > >Perhaps you want to do something like >

Re: [sqlite] Problems with max(datestamp) in subquery

2009-08-17 Thread Leo Freitag
David Bicking-2 wrote: > > As written, you were selecting any record with the correct date > regardless of Ensemble or Steuck. > > David > The following seem to work: SELECT * FROM tblZO_Haupt AS hpt WHERE hpt.zo_tblEnsemble = AND hpt.zo_tblStueck = ... AND hpt.datum = ( SELECT

Re: [sqlite] Does PRAGMA synchronous=OFF ensure that no synching is done for the entire session?

2009-08-17 Thread Angus March
Shane Harrelson wrote: > To the original question though, with PRAGMA synchronous=OFF, SQLite will > NOT do explicit fsync()'s. A exception to this occurs with attached DB's > and a transaction; when the transaction is committed and the master journal > is deleted, SQLite fsyncs the directory

Re: [sqlite] Does PRAGMA synchronous=OFF ensure that no synching is done for the entire session?

2009-08-17 Thread Shane Harrelson
On Mon, Aug 17, 2009 at 11:53 AM, D. Richard Hipp wrote: > > On Aug 17, 2009, at 11:41 AM, Matt Sergeant wrote: > > > > Kernels will fflush when a file handle is closed > > Not according to Ted Ts'o (creator of the Ext2/3/4 filesystems). See, > for example, the extensive

Re: [sqlite] Does PRAGMA synchronous=OFF ensure that no synching is done for the entire session?

2009-08-17 Thread Simon Slavin
On 17 Aug 2009, at 3:47pm, Angus March wrote: > I was concerned > that the documentation might be playing fast and loose, saying that > fflush (or fsync, or fdatasync) won't be called, when it really means > that it won't be called during any call to step() or finalize(), while > it would be

Re: [sqlite] debugging sqlite with gdb

2009-08-17 Thread Simon Slavin
On 17 Aug 2009, at 12:46am, Miroslav Zagorac wrote: > Mohammad Reaz Uddin wrote: >> I downloaded 'sqlite-amalgamation-3.6.16.tar.gz' and used makefile to >> compile it. > > sqlite is a shell script, wrapper to a compiled binary in .libs > directory wrapped in a mystery, inside an enigma.

Re: [sqlite] 3.6.17 test failure

2009-08-17 Thread Ken
--- On Sat, 8/15/09, Dan Kennedy wrote: > From: Dan Kennedy > Subject: Re: [sqlite] 3.6.17 test failure > To: "General Discussion of SQLite Database" > Date: Saturday, August 15, 2009, 12:36 AM > > On Aug 15, 2009, at

Re: [sqlite] Does PRAGMA synchronous=OFF ensure that no synching is done for the entire session?

2009-08-17 Thread Angus March
Matt Sergeant wrote: > On Mon, 17 Aug 2009 10:47:23 -0400, Angus March wrote: > >>> Because yes, that's what synchronous=OFF means. It stops SQLite from >>> issuing fflush calls (effectively). >>> >>> >> Right, and this is implied by the documentation, but I was concerned >> that

Re: [sqlite] Does PRAGMA synchronous=OFF ensure that no synching is done for the entire session?

2009-08-17 Thread Matt Sergeant
On Mon, 17 Aug 2009 10:47:23 -0400, Angus March wrote: >> Because yes, that's what synchronous=OFF means. It stops SQLite from >> issuing fflush calls (effectively). >> > Right, and this is implied by the documentation, but I was concerned > that the documentation might be playing fast and

Re: [sqlite] Does PRAGMA synchronous=OFF ensure that no synching is done for the entire session?

2009-08-17 Thread Angus March
Matt Sergeant wrote: > On Fri, 14 Aug 2009 12:33:30 -0400, Angus March wrote: > >> I want my INSERT done right away, I just don't want it to be flushed >> from the filesystem's write-behind cache until the kernel decides, not >> when SQLite decides. >> > > Did you mean you do "want it

Re: [sqlite] Multiple indexes in SQLite, and selecting which to use

2009-08-17 Thread Shane Harrelson
On Mon, Aug 17, 2009 at 3:15 AM, Dan Kennedy wrote: > >> The INDEXED BY feature was introduced to address concerns that SQLite > >> might > >> suddenly start using a different plan for a query in the field than > >> it > >> did > >> in the office during testing. Either

Re: [sqlite] Problem with sqlite3_column_origin_name and AS Clause

2009-08-17 Thread Igor Tandetnik
Dinu Scheppelmann (DAISY) wrote: > Unfortunately when I get the column names by function > sqlite3_column_origin_name(), the result columns have the names > "DokId", "Name" and "Name" again - instead of "Id", "PatientName" and > "Name"!! You want sqlite3_column_name Igor Tandetnik

Re: [sqlite] Functions to convert dates with non-English month name?

2009-08-17 Thread Igor Tandetnik
Gilles Ganault wrote: > Before I go ahead and write a script to loop through all the rows, I > was wondering if SQLite supports functions to convert DD MM into > the MySQL-friendly -MM-DD, and whether those functions are > localized so that it understands month names in languages other

Re: [sqlite] debugging sqlite with gdb

2009-08-17 Thread Miroslav Zagorac
Mohammad Reaz Uddin wrote: > I downloaded 'sqlite-amalgamation-3.6.16.tar.gz' and used makefile to > compile it. > sqlite is a shell script, wrapper to a compiled binary in .libs directory. -- Zaga You have worked and not worked. Not working is the hardest work of all.

Re: [sqlite] [Duplicates] How to keep only one row?

2009-08-17 Thread Martin Engelschalk
Hi, If you are looking for a delete - command, then you have to decide which of the duplicate rows you want to keep. Are they all the same even in the other fields? Perhaps you want to do something like delete from members where exists (select rowid from members m2 where m2.name = members

[sqlite] Functions to convert dates with non-English month name?

2009-08-17 Thread Gilles Ganault
Hello, Before I go ahead and write a script to loop through all the rows, I was wondering if SQLite supports functions to convert DD MM into the MySQL-friendly -MM-DD, and whether those functions are localized so that it understands month names in languages other than English? Here's an

[sqlite] Problem with sqlite3_column_origin_name and AS Clause

2009-08-17 Thread Dinu Scheppelmann (DAISY)
Hello to all SQLite people (that's my first post - please be patient:-)) I already searched the mailings from 2008/2009 but could not find a post that describes this problem. I have a select over a few tables, and since many tables use identical names for some columns (like "Id"), I rename the

[sqlite] querying r-trees

2009-08-17 Thread Martin Pfeifle
Dear all, I would like to discuss a new feature in the SQLite R-tree which is not very difficult to implement but would improve query performance a lot for use cases where the MBR (minimum bounding rectangle) of the query object leads to a too large candidate set. First of all the data

[sqlite] [Duplicates] How to keep only one row?

2009-08-17 Thread Gilles Ganault
Hello I have a table that has a lot of duplicates in the Name column. I'd like to only keep one row for each. The following lists the duplicates, but I don't know how to delete the duplicates and just keep one: SELECT name FROM members GROUP BY name HAVING COUNT(*) > 1; Thank you.

Re: [sqlite] Multiple indexes in SQLite, and selecting which to use

2009-08-17 Thread Dan Kennedy
>> The INDEXED BY feature was introduced to address concerns that SQLite >> might >> suddenly start using a different plan for a query in the field than >> it >> did >> in the office during testing. Either because somebody ran ANALYZE, or >> because >> the SQLite version was upgraded. In this

Re: [sqlite] Multiple indexes in SQLite, and selecting which to use

2009-08-17 Thread John Machin
On 17/08/2009 2:37 PM, Dan Kennedy wrote: > On Aug 17, 2009, at 11:05 AM, John Machin wrote: > >> On 17/08/2009 11:41 AM, Shane Harrelson wrote: >>> INDEXED BY doesn't allow you to specify which index to use. It >>> just causes >>> the query to fail if SQLite thinks it should use an index