Re: [sqlite] Adding WHERE to query --> database disk image is malformed

2014-06-24 Thread Jerry Krinock
On 2014 Jun 24, at 14:46, David Empson wrote: > The most likely explanation is that it got processed by something which > thought it should be treated as ASCII text and was doing a spurious LF-to-CR > translation. If there was only one 0x0A byte in the "good" file, then that is > the only one

Re: [sqlite] Sequential numbers

2014-06-24 Thread Simon Slavin
On 24 Jun 2014, at 9:47pm, Dave Wellman wrote: > Included in that page is the following: > > Note that "monotonically increasing" does not imply that the ROWID always > increases by exactly one. One is the usual increment. However, if an insert > fails due to (for example) a uniqueness constrai

Re: [sqlite] Adding WHERE to query --> database disk image is malformed

2014-06-24 Thread Igor Tandetnik
On 6/24/2014 6:04 PM, Peter Haworth wrote: SELECT * FROM itemTable WHERE +key = 'profileName' ; Note the + sign - this suppresses the use of index. That's really interesting - I've never seen that use of the "+" sign mentioned in the docs. http://www.sqlite.org/optoverview.html To be usable

Re: [sqlite] Adding WHERE to query --> database disk image is malformed

2014-06-24 Thread Peter Haworth
> > > SELECT * FROM itemTable WHERE +key = 'profileName' ; > > Note the + sign - this suppresses the use of index. > -- > Igor Tandetnik > That's really interesting - I've never seen that use of the "+" sign mentioned in the docs. Pete lcSQL Software Home of lcStackBrowser

[sqlite] [ANN] SQLiteAdmin V 1.3.5 Released

2014-06-24 Thread Peter Haworth
SqliteAdmin V 1.3.5 is now available for download at www.lcsql.com/sqliteadmin.html. This version includes support for several recent language additions such as CREATE TABLE WITHOUT ROWID and the CREATE INDEX WHERE clause. Several other enhancements are included and the full release notes can be f

Re: [sqlite] Adding WHERE to query --> database disk image is malformed

2014-06-24 Thread David Empson
On 25/06/2014, at 8:29 am, Jerry Krinock wrote: > On 2014 Jun 24, at 00:06, Clemens Ladisch wrote: >> Is there any other 0x0A byte in the good file? > > No, only that one. That leads to a plausible theory: had you done anything with the "good" database along the lines of storing it in a versi

Re: [sqlite] Sequential numbers

2014-06-24 Thread Petite Abeille
On Jun 24, 2014, at 10:47 PM, Dave Wellman wrote: > I need the values to be sequential. Well… if your data set is as small as you mentioned (20 records or less)… you could roll your own numbering schema with the simple expedient of attaching a trigger to your tables to auto -number them with

Re: [sqlite] Sequential numbers

2014-06-24 Thread Dave Wellman
Hi Roger, Many thanks for that, I think its close to what I'm looking for. However, according to that document page the autoincr feature doesn't gaurantee 'sequential' numbers. Included in that page is the following: Note that "monotonically increasing" does not imply that the ROWID always increas

Re: [sqlite] Adding WHERE to query --> database disk image is malformed

2014-06-24 Thread Richard Hipp
On Tue, Jun 24, 2014 at 4:29 PM, Jerry Krinock wrote: > > Thank you, Clemens. 0x0A=index. 0x0D=table. I suppose that is a > sensible re-use of “carrige return” and “line feed”. > Indexes and tables can have several different initial bytes, depending on circumstances. Any relationship to ASC

Re: [sqlite] Adding WHERE to query --> database disk image is malformed

2014-06-24 Thread Jerry Krinock
(I think it’s cleaner to reply to three replies in one message; here goes…) On 2014 Jun 23, at 22:43, Keith Medcalf wrote: > Unique is implemented (as it must be) via a unique index. Very good, Keith. So my database *does* have an index. > You should be able to rebuild the corrupted index wit

Re: [sqlite] Sequential numbers

2014-06-24 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 24/06/14 13:02, Dave Wellman wrote: > I have some rows in a table (not very many, typically less than 20) and > I want to generate a unique, sequential number for each row. http://www.sqlite.org/autoinc.html Roger -BEGIN PGP SIGNATURE- Ver

[sqlite] Sequential numbers

2014-06-24 Thread Dave Wellman
Hi all, I have some rows in a table (not very many, typically less than 20) and I want to generate a unique, sequential number for each row. In another dbms I've used a row_number function (amongst others) to achieve this but I can't see anything with equivalent functionality in sqlite3. My apo

Re: [sqlite] Adding WHERE to query --> database disk image is malformed

2014-06-24 Thread Eduardo Morras
On Mon, 23 Jun 2014 20:16:44 -0700 Jerry Krinock wrote: > How can it be that adding a WHERE clause to a successful query causes > ‘database disk image is malformed’? > > My database has one table named `itemTable`. This table has two > columns, `key` which is type text and `value` which is type

Re: [sqlite] Adding WHERE to query --> database disk image is malformed

2014-06-24 Thread Clemens Ladisch
Jerry Krinock wrote: > On 2014 Jun 23, at 21:49, Igor Tandetnik wrote: >> The data corruption happens to affect the area of the file where >> this index is stored. > > The culprit is byte 2048, the first byte in the 3rd page. In the Good > file, it is 0x0A and in the Bad file, it’s 0x0D.