Re: [sqlite] AUTOINCREMENT hi-level not updated when rowid updated -- Correct Behaviour?

2017-02-02 Thread Keith Medcalf
On Thursday, 2 February, 2017 18:56, Richard Hipp wrote: > The behavior is correct. > I have adjusted the documentation to try to avoid ambiguity. See > https://www.sqlite.org/docsrc/info/f6e2eab4e71644b1 for the > documentation update. The ROWID chosen for the new row is

Re: [sqlite] AUTOINCREMENT hi-level not updated when rowid updated -- Correct Behaviour?

2017-02-02 Thread Richard Hipp
The behavior is correct. I have adjusted the documentation to try to avoid ambiguity. See https://www.sqlite.org/docsrc/info/f6e2eab4e71644b1 for the documentation update. On 2/2/17, Keith Medcalf wrote: > > sqlite> create table x (key integer primary key, value text); >

[sqlite] AUTOINCREMENT hi-level not updated when rowid updated -- Correct Behaviour?

2017-02-02 Thread Keith Medcalf
sqlite> create table x (key integer primary key, value text); sqlite> insert into x values (null, 'test'); sqlite> update x set key=1 where value='test'; sqlite> select * from x; 1|test sqlite> delete from x; sqlite> insert into x values (null, 'again'); sqlite> select * from x; 1|again

Re: [sqlite] Autoincrement sequence not updated by UPDATE

2016-11-03 Thread Keith Medcalf
> To: SQLite mailing list > Subject: Re: [sqlite] Autoincrement sequence not updated by UPDATE > > On Tue, 1 Nov 2016 11:01:24 + > Simon Slavin <slav...@bigfraud.org> wrote: > > > attempts to change a value in that column using UPDATE always > > generat

Re: [sqlite] Autoincrement sequence not updated by UPDATE

2016-11-03 Thread James K. Lowden
On Tue, 1 Nov 2016 11:01:24 + Simon Slavin wrote: > attempts to change a value in that column using UPDATE always > generate an error. I didn't know that. I looked it up. Apparently > Microsoft's SQLSERVER blocks it Blocks but does not prevent.

Re: [sqlite] Autoincrement sequence not updated by UPDATE

2016-11-01 Thread David Raymond
sqlite> create table tbl1 ...> ( ...> id integer primary key autoincrement, ...> someOtherfield, ...> yetAnotherField ...> ); sqlite> create trigger trg_imInChargeAndSayNoAutoincrementUpdates ...> before update of id on tbl1 ...> begin ...> select raise(abort, 'Bad

Re: [sqlite] Autoincrement sequence not updated by UPDATE

2016-11-01 Thread Andy Ling
say about auto increment is that it will create a unique number. Andy -Original Message- From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On Behalf Of Tony Papadimitriou Sent: Tue 01 November 2016 13:09 To: SQLite mailing list Subject: Re: [sqlite] Autoincrement

Re: [sqlite] Autoincrement sequence not updated by UPDATE

2016-11-01 Thread Tony Papadimitriou
| ++---+ | 3 | three | | 10 | one | | 30 | two | ++---+ -Original Message- From: Simon Slavin Sent: Tuesday, November 01, 2016 1:50 PM To: SQLite mailing list Subject: Re: [sqlite] Autoincrement sequence not updated by UPDATE On 1 Nov 2016, at 11:44am, Andy Ling

Re: [sqlite] Autoincrement sequence not updated by UPDATE

2016-11-01 Thread Andy Ling
>> It remembers.. >Ah, neat. Thanks for the testing. As a slight aside. It also never resets the value. We had a problem where the number of inserts had incremented the AUTO INCREMENT value to MAXINT (it took a few years). It then stops. We fixed it by changing id to a BIGINT, but you can

Re: [sqlite] Autoincrement sequence not updated by UPDATE

2016-11-01 Thread Simon Slavin
On 1 Nov 2016, at 11:44am, Andy Ling wrote: > It remembers.. Ah, neat. Thanks for the testing. And the "show create table" command you used makes it clear that the engine keeps a record for the table. Apparently a single value for the table's primary key rather

Re: [sqlite] Autoincrement sequence not updated by UPDATE

2016-11-01 Thread Andy Ling
[mailto:sqlite-users-boun...@mailinglists.sqlite.org] On Behalf Of Simon Slavin Sent: Tue 01 November 2016 11:42 To: SQLite mailing list Subject: Re: [sqlite] Autoincrement sequence not updated by UPDATE On 1 Nov 2016, at 11:14am, Andy Ling <andy.l...@s-a-m.com> wrote: > MySQL lets y

Re: [sqlite] Autoincrement sequence not updated by UPDATE

2016-11-01 Thread R Smith
On 2016/11/01 1:01 PM, Simon Slavin wrote: On 1 Nov 2016, at 10:45am, R Smith wrote: D - Horrible if you up some key value significantly and then update it back down, because there is no way the Autoinc value should *EVER* be able/allowed to come back down. It's a

Re: [sqlite] Autoincrement sequence not updated by UPDATE

2016-11-01 Thread Simon Slavin
On 1 Nov 2016, at 11:14am, Andy Ling wrote: > MySQL lets you fiddle. I don't have MySQL. To satisfy my curiosity, could you try this: create table tt (id int NOT NULL AUTO_INCREMENT, v TEXT, PRIMARY KEY(id)) ; insert into tt (v) VALUES("one"); update tt set id=10

Re: [sqlite] Autoincrement sequence not updated by UPDATE

2016-11-01 Thread Andy Ling
> Which, according to GB, is what some other SQL engines do: attempts to change > a value > in that column using UPDATE always generate an error. I didn't know that. > I looked it up. > Apparently Microsoft's SQLSERVER blocks it, but I was unable to find > anything mentioning > how any of

Re: [sqlite] Autoincrement sequence not updated by UPDATE

2016-11-01 Thread Richard Damon
On 11/1/16 7:01 AM, Simon Slavin wrote: On 1 Nov 2016, at 10:45am, R Smith wrote: D - Horrible if you up some key value significantly and then update it back down, because there is no way the Autoinc value should *EVER* be able/allowed to come back down. It's a one-way

Re: [sqlite] Autoincrement sequence not updated by UPDATE

2016-11-01 Thread Simon Slavin
On 1 Nov 2016, at 10:45am, R Smith wrote: > D - Horrible if you up some key value significantly and then update it back > down, because there is no way the Autoinc value should *EVER* be able/allowed > to come back down. It's a one-way street. This is an additional

Re: [sqlite] Autoincrement sequence not updated by UPDATE

2016-11-01 Thread R Smith
On 2016/11/01 11:52 AM, Simon Slavin wrote: Unfortunately the response is going to be along the lines of "We can't do this for compatibility reasons because there might be a program out there that does it.". And rightly so... There is no reason to use Autoincrement other to be sure newly

Re: [sqlite] Autoincrement sequence not updated by UPDATE

2016-11-01 Thread Simon Slavin
On 1 Nov 2016, at 6:56am, GB wrote: > And that is why several SQL Engines prevent AUTOINCREMENT columns from being > UPDATEd. I think that would be a good fix in SQLite's case. If you're relying on SQLite to generate these unique numbers for you then you shouldn't then change

Re: [sqlite] Autoincrement sequence not updated by UPDATE

2016-11-01 Thread Niall O'Reilly
On 28 Oct 2016, at 12:47, Simon Slavin wrote: It guess it comes down to what one wants from "INTEGER PRIMARY KEY AUTOINCREMENT". If the requirement is only-ever-increasing then this is a bug. The behaviour described at https://sqlite.org/autoinc.html seems to match this requirement:

Re: [sqlite] Autoincrement sequence not updated by UPDATE

2016-11-01 Thread GB
And that is why several SQL Engines prevent AUTOINCREMENT columns from being UPDATEd. I think it should be fixed in the Docs, not in Code. Richard Hipp schrieb am 31.10.2016 um 18:56: Note that the implied purpose of AUTOINCREMENT is to generate a unique and immutable identifier. Running

Re: [sqlite] Autoincrement sequence not updated by UPDATE

2016-10-31 Thread Don V Nielsen
> It guess it comes down to what one wants from "INTEGER PRIMARY KEY AUTOINCREMENT" What I would want, ...expect, is that a primary key autoincrement column would be left completely alone. And if was altered, it was altered on accident. I always thought "integer primary key" was synonymous with

Re: [sqlite] Autoincrement sequence not updated by UPDATE

2016-10-31 Thread Richard Hipp
On 10/27/16, Adam Goldman wrote: > I expected the test case below to print 5679, but it prints 1235 > instead. I tested under a few versions including 3.15.0. It's a bit of a > corner case and I worked around it in my application, but I guess it's a > bug. > > CREATE TABLE foo

Re: [sqlite] Autoincrement sequence not updated by UPDATE

2016-10-28 Thread Simon Slavin
SQLite version 3.14.0 2016-07-26 15:17:14 Enter ".help" for usage hints. Connected to a transient in-memory database. Use ".open FILENAME" to reopen on a persistent database. sqlite> CREATE TABLE foo (bar INTEGER PRIMARY KEY AUTOINCREMENT); sqlite> INSERT INTO foo (bar) VALUES(1234); sqlite>

Re: [sqlite] Autoincrement sequence not updated by UPDATE

2016-10-28 Thread Stephen Chrzanowski
Works here; SQLite version 3.13.0 2016-05-18 10:57:30 Enter ".help" for usage hints. Connected to a transient in-memory database. Use ".open FILENAME" to reopen on a persistent database. sqlite> CREATE TABLE foo (bar INTEGER PRIMARY KEY AUTOINCREMENT); sqlite> INSERT INTO foo (bar) VALUES(1234);

Re: [sqlite] Autoincrement sequence not updated by UPDATE

2016-10-28 Thread Radovan Antloga
After line: UPDATE foo SET bar=5678; put this sql command: COMMIT; If you execute all statements in one sql (except last), they are executed in one transaction. Regards Radovan Adam Goldman je 27.10.2016 ob 11:52 napisal: Hi, I expected the test case below to print 5679, but it prints 1235

[sqlite] Autoincrement sequence not updated by UPDATE

2016-10-27 Thread Adam Goldman
Hi, I expected the test case below to print 5679, but it prints 1235 instead. I tested under a few versions including 3.15.0. It's a bit of a corner case and I worked around it in my application, but I guess it's a bug. CREATE TABLE foo (bar INTEGER PRIMARY KEY AUTOINCREMENT); INSERT INTO foo

[sqlite] autoincrement

2016-04-13 Thread Igor Korot
Hi, On Wed, Apr 13, 2016 at 1:54 PM, Igor Korot wrote: > Hi, Peter, > > On Wed, Apr 13, 2016 at 1:16 PM, Peter Aronson wrote: >> There is one limitation to this approach, however. The entry for an >> autoincrement column in the sqlite_sequence table isn't made until the first >> row is

[sqlite] autoincrement

2016-04-13 Thread R Smith
On 2016/04/13 4:58 PM, Igor Korot wrote: > Hi,, > > On Wed, Apr 13, 2016 at 10:54 AM, J Decker wrote: >> Yes, you can get the create statement from sqlite_master table > I was kind of hoping for a simpler solution so that not to parse "CREATE > TABLE" > statement... > > Well, I guess I will

[sqlite] autoincrement

2016-04-13 Thread Peter Aronson
The documentation for sqlite3_table_column_metadata C function can be found here; https://www.sqlite.org/c3ref/table_column_metadata.html. You just call it in turn on each column in a table (you can get the column names for a table by using Pragma table_info) and check the value of the 9th

[sqlite] autoincrement

2016-04-13 Thread Kees Nuyt
On Wed, 13 Apr 2016 10:58:54 -0400, Igor Korot wrote: > Hi,, > >On Wed, Apr 13, 2016 at 10:54 AM, J Decker wrote: >> Yes, you can get the create statement from sqlite_master table > > I was kind of hoping for a simpler solution so that not to > parse "CREATE TABLE" statement... > > Well, I

[sqlite] autoincrement

2016-04-13 Thread Peter Aronson
There is one limitation to this approach, however. ?The entry for an autoincrement column in the sqlite_sequence table isn't made until the first row is inserted into the table. ?If you are also using the C interface, you can identify autoincrement columns using?sqlite3_table_column_metadata.

[sqlite] autoincrement

2016-04-13 Thread Igor Korot
Hi, Peter, On Wed, Apr 13, 2016 at 1:16 PM, Peter Aronson wrote: > There is one limitation to this approach, however. The entry for an > autoincrement column in the sqlite_sequence table isn't made until the first > row is inserted into the table. If you are also using the C interface, you

[sqlite] autoincrement

2016-04-13 Thread Igor Korot
Hi, Kees, On Wed, Apr 13, 2016 at 12:15 PM, Kees Nuyt wrote: > On Wed, 13 Apr 2016 10:58:54 -0400, Igor Korot > wrote: > >> Hi,, >> >>On Wed, Apr 13, 2016 at 10:54 AM, J Decker wrote: >>> Yes, you can get the create statement from sqlite_master table >> >> I was kind of hoping for a simpler

[sqlite] autoincrement

2016-04-13 Thread Igor Korot
Hi,, On Wed, Apr 13, 2016 at 10:54 AM, J Decker wrote: > Yes, you can get the create statement from sqlite_master table I was kind of hoping for a simpler solution so that not to parse "CREATE TABLE" statement... Well, I guess I will have to. Thank you. > > On Wed, Apr 13, 2016 at 4:54 AM,

[sqlite] autoincrement

2016-04-13 Thread J Decker
Yes, you can get the create statement from sqlite_master table On Wed, Apr 13, 2016 at 4:54 AM, Igor Korot wrote: > Hi, > Is it possible to get whether the column is set to autoincrement or not? > > PRAGMA table_info() does not give such info... > > Thank you. >

[sqlite] autoincrement

2016-04-13 Thread Igor Korot
Hi, Is it possible to get whether the column is set to autoincrement or not? PRAGMA table_info() does not give such info... Thank you.

[sqlite] autoincrement field

2015-08-28 Thread Levente Kovacs
On Thu, 27 Aug 2015 23:40:15 +0200 Jean-Christophe Deschamps wrote: > http://www.sqlite.org/c3ref/last_insert_rowid.html is what you need. Yes, thanks a lot! Lev

[sqlite] autoincrement field

2015-08-28 Thread Jean-Christophe Deschamps
At 23:25 27/08/2015, you wrote: >--- >I have a table structure like this: > >CREATE TABLE padstack ( > id INTEGER PRIMARY KEY AUTOINCREMENT, > pin_number INTEGER, > name TEXT >); > >Is there any way to get the 'id' of newly inserted row? My insert of >course >not contains the 'id'

[sqlite] autoincrement field

2015-08-28 Thread Levente Kovacs
I have a table structure like this: CREATE TABLE padstack ( id INTEGER PRIMARY KEY AUTOINCREMENT, pin_number INTEGER, name TEXT ); Is there any way to get the 'id' of newly inserted row? My insert of course not contains the 'id' field. Thanks, Lev

[sqlite] autoincrement field

2015-08-27 Thread Richard Hipp
On 8/27/15, Levente Kovacs wrote: > On Thu, 27 Aug 2015 23:40:15 +0200 > Jean-Christophe Deschamps wrote: > >> http://www.sqlite.org/c3ref/last_insert_rowid.html is what you need. > > Yes, thanks a lot! You should probably also read the documentation on AUTOINCREMENT

[sqlite] autoincrement field

2015-08-27 Thread Igor Tandetnik
On 8/27/2015 5:25 PM, Levente Kovacs wrote: > Is there any way to get the 'id' of newly inserted row? http://www.sqlite.org/c3ref/last_insert_rowid.html http://www.sqlite.org/lang_corefunc.html#last_insert_rowid -- Igor Tandetnik

Re: [sqlite] Autoincrement with rollback

2014-11-11 Thread Koen Van Exem
Hi Darren, Thanks for explaining the internals. I already assumed by my 2 small experiments that this was the case but it's nice to have it confirmed. With kind regards, Koen 2014-11-11 12:05 GMT+01:00 Darren Duncan : > On 2014-11-11 2:41 AM, Koen Van Exem wrote: >

Re: [sqlite] Autoincrement with rollback

2014-11-11 Thread Darren Duncan
On 2014-11-11 2:41 AM, Koen Van Exem wrote: I find it a bit confusing because when you create a PRIMARY KEY AUTOINCREMENT then a table named sqlite_sequence is created. According to the SQL (2003) standard multiple sessions are guaranteed to allocate distinct sequence values. (even when

Re: [sqlite] Autoincrement with rollback

2014-11-11 Thread Koen Van Exem
I find it a bit confusing because when you create a PRIMARY KEY AUTOINCREMENT then a table named sqlite_sequence is created. According to the SQL (2003) standard multiple sessions are guaranteed to allocate distinct sequence values. (even when rollbacks are involved) 2014-11-11 11:14 GMT+01:00

Re: [sqlite] Autoincrement with rollback

2014-11-11 Thread J Decker
delete it and commit it... rollback is 'undo' and if anything was differen't it wouldn't be a very good undo. assign the key yourself? on failure keep incrementing? if it's supposed to have been inserted and deleted... then rollback is not the correct solution. On Tue, Nov 11, 2014 at 2:04 AM,

Re: [sqlite] Autoincrement with rollback

2014-11-11 Thread Andy Ling
> --- Begin --- > > sqlite> drop table if exists demo; > sqlite> create table demo (id integer primary key autoincrement, value > text); > sqlite> begin transaction; > sqlite> insert into demo (value) VALUES ('value'); > sqlite> select last_insert_rowid(); > 1 > sqlite> delete from demo where id

Re: [sqlite] Autoincrement with rollback

2014-11-11 Thread Koen Van Exem
--- Begin --- sqlite> drop table if exists demo; sqlite> create table demo (id integer primary key autoincrement, value text); sqlite> begin transaction; sqlite> insert into demo (value) VALUES ('value'); sqlite> select last_insert_rowid(); 1 sqlite> delete from demo where id = 1; sqlite>

Re: [sqlite] Autoincrement with rollback

2014-11-11 Thread Clemens Ladisch
Koen Van Exem wrote: > Is it a bug or feature that the autoincrement > value is being reused when a rollback is issued? > > The documentation on https://www.sqlite.org/autoinc.html is a bit unclear > > ... it says it prevents reuse of ROWIDs from previously deleted rows. Only a DELETE statement

[sqlite] Autoincrement with rollback

2014-11-11 Thread Koen Van Exem
Hi, Is it a bug or feature that the autoincrement value is being reused when a rollback is issued? --- Begin --- sqlite> drop table if exists demo; sqlite> create table demo (id integer primary key autoincrement, value text); sqlite> begin transaction; sqlite> insert into demo (value) VALUES

Re: [sqlite] AUTOINCREMENT BIGINT

2014-11-07 Thread Michele Pradella
Ok understand thanks Il 07/11/2014 14.40, Richard Hipp ha scritto: On Fri, Nov 7, 2014 at 8:26 AM, Michele Pradella

Re: [sqlite] AUTOINCREMENT BIGINT

2014-11-07 Thread Richard Hipp
On Fri, Nov 7, 2014 at 8:26 AM, Michele Pradella wrote: > > Is there a way to sue AUTOINCREMENT with BIGINT? what's the reason for > this check? > No. Furthermore, AUTOINCREMENT probably does not do what you think it does. Please read the details at

Re: [sqlite] AUTOINCREMENT BIGINT

2014-11-07 Thread Clemens Ladisch
Michele Pradella wrote: > I have a question about data type BIGINT BIGINT is not a data type. > from docs (http://www.sqlite.org/datatype3.html) This page says the data types are NULL, INTEGER, REAL, TEXT, and BLOB. > I understand that INTEGER and BIGINT results in the same affinity Yes. >

[sqlite] AUTOINCREMENT BIGINT

2014-11-07 Thread Michele Pradella
Hi all, I have a question about data type BIGINT: from docs (http://www.sqlite.org/datatype3.html) I understand that INTEGER and BIGINT results in the same affinity (INTEGER), so datatypes are same, is it correct? Unfortunately if I create a table with a field "Id BIGINT PRIMARY KEY

Re: [sqlite] AUTOINCREMENT

2014-07-27 Thread RSmith
On 2014/07/27 12:07, michael walsley wrote: Why doesn't AUTOINCREMENT work like rowid, in that, with rowid if the value on insert is not null it doesn't get a new rowid, it just accepts the value as in the insert? Im trying to develop a win phone app in that data downloaded from the

Re: [sqlite] AUTOINCREMENT

2014-07-27 Thread Clemens Ladisch
On 07/27/2014 12:07 PM, michael walsley wrote: > Why doesn't AUTOINCREMENT work like rowid, in that, with rowid if the value > on insert is not null it doesn't get a new rowid, it just accepts the value > as in the insert? sqlite> create table t(x integer primary key autoincrement); sqlite>

[sqlite] AUTOINCREMENT

2014-07-27 Thread michael walsley
Why doesn't AUTOINCREMENT work like rowid, in that, with rowid if the value on insert is not null it doesn't get a new rowid, it just accepts the value as in the insert? Im trying to develop a win phone app in that data downloaded from the server needs to insert as it comes, but rows added on

Re: [sqlite] autoincrement and primary key

2013-05-20 Thread Roman Fleysher
[i...@tandetnik.org] Sent: Monday, May 20, 2013 4:41 PM To: sqlite-users@sqlite.org Subject: Re: [sqlite] autoincrement and primary key On 5/20/2013 4:17 PM, Roman Fleysher wrote: > I would like to use INTEGER PRIMARY KEY, but I would like to disable its > implicit AUTOINCREMENT featur

Re: [sqlite] autoincrement and primary key

2013-05-20 Thread Igor Tandetnik
On 5/20/2013 4:17 PM, Roman Fleysher wrote: I would like to use INTEGER PRIMARY KEY, but I would like to disable its implicit AUTOINCREMENT feature. Namely, if INSERT specifies value of the column, I would like uniqueness to be enforced, but if NULL is supplied, I would like the operation to

Re: [sqlite] autoincrement and primary key

2013-05-20 Thread Jean-Christophe Deschamps
I would like to use INTEGER PRIMARY KEY, but I would like to disable its implicit AUTOINCREMENT feature. Namely, if INSERT specifies value of the column, I would like uniqueness to be enforced, but if NULL is supplied, I would like the operation to fail instead of advancing key to a new

[sqlite] autoincrement and primary key

2013-05-20 Thread Roman Fleysher
Dear SQLiters, I would like to use INTEGER PRIMARY KEY, but I would like to disable its implicit AUTOINCREMENT feature. Namely, if INSERT specifies value of the column, I would like uniqueness to be enforced, but if NULL is supplied, I would like the operation to fail instead of advancing key

Re: [sqlite] Autoincrement failure

2011-08-26 Thread Black, Michael (IS)
Discussion of SQLite Database Subject: EXT :Re: [sqlite] Autoincrement failure SELECT rowid FROM (mytable) WHERE (mystuff) returns 37 identical rows(!) where Rowid = 1 Alessandro From: a.azzol...@custom.it To: <sqlite-users@sqlite.org> Date: 22/08/2011 16.26 Subject: Re: [

Re: [sqlite] Autoincrement failure

2011-08-24 Thread Simon Slavin
On 24 Aug 2011, at 1:13pm, a.azzol...@custom.it wrote: > On my laptop integrity_check fail > >> PRAGMA integrity_check >> returns >> >> *** in database main *** >> rowid 0 missing from index JournalDateIndex >> rowid 0 missing from index sqlite_autoindex_Journal_1 >> wrong # of entries in

Re: [sqlite] Autoincrement failure

2011-08-24 Thread A . Azzolini
: General Discussion of SQLite Database <sqlite-users@sqlite.org> Date: 23/08/2011 18.44 Subject: Re: [sqlite] Autoincrement failure On 23 Aug 2011, at 4:28pm, a.azzol...@custom.it wrote: > I cannot run a shell sqlite3 on my embedded system. I will explain it > using your example. At

Re: [sqlite] Autoincrement failure

2011-08-23 Thread Simon Slavin
On 23 Aug 2011, at 4:28pm, a.azzol...@custom.it wrote: > I cannot run a shell sqlite3 on my embedded system. I will explain it > using your example. At some point your database file is becoming corrupt. > It happen that sometime autoincrement begin to fail > and new records overwrite the one

Re: [sqlite] Autoincrement failure

2011-08-23 Thread Black, Michael (IS)
From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on behalf of a.azzol...@custom.it [a.azzol...@custom.it] Sent: Tuesday, August 23, 2011 10:28 AM To: General Discussion of SQLite Database Subject: EXT :Re: [sqlite] Autoincrement failure Sorry, I cannot run a shell sqlite3

Re: [sqlite] Autoincrement failure

2011-08-23 Thread A . Azzolini
IS)" <michael.bla...@ngc.com> To: General Discussion of SQLite Database <sqlite-users@sqlite.org> Date: 23/08/2011 17.07 Subject: Re: [sqlite] Autoincrement failure Your insert looks OK...can you run sqlite3 on your embedded system? Try this and see what you get...I ran this

Re: [sqlite] Autoincrement failure

2011-08-23 Thread Black, Michael (IS)
55 AM To: General Discussion of SQLite Database Subject: EXT :Re: [sqlite] Autoincrement failure table definition: "CREATE TABLE Journal (ClosureNum INTEGER, TicketNum INTEGER, ItemNum INTEGER, Date DATE, Time TIME, Item BLOB, PRIMARY KEY(ClosureNum, TicketNum, ItemNum))" example inser

Re: [sqlite] Autoincrement failure

2011-08-23 Thread A . Azzolini
; To: General Discussion of SQLite Database <sqlite-users@sqlite.org> Date: 23/08/2011 15.50 Subject: Re: [sqlite] Autoincrement failure Could you please show us your table definition and an example insert statement that your generating? Michael D. Black Senior Scientis

Re: [sqlite] Autoincrement failure

2011-08-23 Thread Simon Slavin
On 23 Aug 2011, at 2:35pm, a.azzol...@custom.it wrote: > Normally INSERT operations of new records works fine. Perhaps, > autoincrement failure is due to electrical pbm and is present only on few > devices > but I'm looking for a way to protect DB file against this pbm. > > This failure is a

Re: [sqlite] Autoincrement failure

2011-08-23 Thread Black, Michael (IS)
...@sqlite.org] on behalf of a.azzol...@custom.it [a.azzol...@custom.it] Sent: Tuesday, August 23, 2011 8:35 AM To: General Discussion of SQLite Database Subject: EXT :Re: [sqlite] Autoincrement failure I'm using SQLite on embedded system (ARM processor) and DB file is on MMC memory. Normally INSERT

Re: [sqlite] Autoincrement failure

2011-08-23 Thread A . Azzolini
..@sqlite.org> To: General Discussion of SQLite Database <sqlite-users@sqlite.org> Date: 23/08/2011 15.42 Subject: Re: [sqlite] Autoincrement failure On Tue, Aug 23, 2011 at 9:35 AM, <a.azzol...@custom.it> wrote: > IMy table has three primary key, autoincrement active and o

Re: [sqlite] Autoincrement failure

2011-08-23 Thread Richard Hipp
On Tue, Aug 23, 2011 at 9:35 AM, wrote: > IMy table has three primary key, autoincrement active and other description > column like > The AUTOINCREMENT feature of SQLite only works if there is a single INTEGER PRIMARY KEY. Please send us the text of the CREATE TABLE

Re: [sqlite] Autoincrement failure

2011-08-23 Thread A . Azzolini
cussion of SQLite Database <sqlite-users@sqlite.org> Date: 23/08/2011 14.10 Subject: Re: [sqlite] Autoincrement failure Give the recent notice of a bug in gcc-4.1 what compiler are you using and how are you compiling? And can you reproduce this with a small example table? Michae

Re: [sqlite] Autoincrement failure

2011-08-23 Thread Black, Michael (IS)
: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on behalf of a.azzol...@custom.it [a.azzol...@custom.it] Sent: Tuesday, August 23, 2011 7:01 AM To: General Discussion of SQLite Database Subject: EXT :Re: [sqlite] Autoincrement failure Reindex procedure returns 'no_error' but rowid

Re: [sqlite] Autoincrement failure

2011-08-23 Thread A . Azzolini
, Alessandro From: Richard Hipp <d...@sqlite.org> To: General Discussion of SQLite Database <sqlite-users@sqlite.org> Date: 22/08/2011 17.40 Subject: Re: [sqlite] Autoincrement failure On Mon, Aug 22, 2011 at 11:25 AM, <a.azzol...@custom.it> wrote: > schema 3 > > PRAGM

Re: [sqlite] Autoincrement failure

2011-08-22 Thread Richard Hipp
t; > > 37 identical rows(!) where Rowid = 1 > > > > What is your schema? > > If you run "PRAGMA integrity_check"? > > > > > > > > > > Alessandro > > > > > > > > > > From: > > a.azzol...@custom

Re: [sqlite] Autoincrement failure

2011-08-22 Thread A . Azzolini
t;d...@sqlite.org> To: General Discussion of SQLite Database <sqlite-users@sqlite.org> Date: 22/08/2011 17.21 Subject: Re: [sqlite] Autoincrement failure On Mon, Aug 22, 2011 at 11:17 AM, <a.azzol...@custom.it> wrote: > SELECT rowid FROM (mytable) WHERE (mystuff) > > re

Re: [sqlite] Autoincrement failure

2011-08-22 Thread Richard Hipp
ssandro > > > > > From: > a.azzol...@custom.it > To: > <sqlite-users@sqlite.org> > Date: > 22/08/2011 16.26 > Subject: > Re: [sqlite] Autoincrement failure > > > > sqlite> .dump sqlite_sequence > PRAGMA foreign_keys=OFF; > BEGIN TRANSACTI

Re: [sqlite] Autoincrement failure

2011-08-22 Thread A . Azzolini
SELECT rowid FROM (mytable) WHERE (mystuff) returns 37 identical rows(!) where Rowid = 1 Alessandro From: a.azzol...@custom.it To: <sqlite-users@sqlite.org> Date: 22/08/2011 16.26 Subject: Re: [sqlite] Autoincrement failure sqlite> .dump sqlite_sequence PRAGMA foreign

Re: [sqlite] Autoincrement failure

2011-08-22 Thread A . Azzolini
sqlite> .dump sqlite_sequence PRAGMA foreign_keys=OFF; BEGIN TRANSACTION; COMMIT; sqlite> Any idea? Thanks Alessandro From: Richard Hipp <d...@sqlite.org> To: General Discussion of SQLite Database <sqlite-users@sqlite.org> Date: 22/08/2011 16.11 Subject: Re: [sqlite] Aut

Re: [sqlite] Autoincrement failure

2011-08-22 Thread Richard Hipp
On Mon, Aug 22, 2011 at 9:56 AM, wrote: > Hallo, > > Have you ever seen a SQLite3 DB file with autoincrement algoritm broken? > Every new record seems to be added with rowid=1 overwriting existing > info... > > Any idea about the causes of this issue > and about extracting

[sqlite] Autoincrement failure

2011-08-22 Thread A . Azzolini
Hallo, Have you ever seen a SQLite3 DB file with autoincrement algoritm broken? Every new record seems to be added with rowid=1 overwriting existing info... Any idea about the causes of this issue and about extracting lost data (if present)? Many thanks Alessandro

Re: [sqlite] AUTOINCREMENT documentation.

2009-02-18 Thread Marcin Walkowiak - Work (local #2)
> > Not exactly, > in monotonically increasing sequence next element is always smaller than > current. > I mean larger :-) Sorry, KoD ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] AUTOINCREMENT documentation.

2009-02-18 Thread Marcin Walkowiak - Work (local #2)
Troeger, Thomas (ext) wrote: > Hello, > > Sorry if this has been asked before, I couldn't find any reference to it > in the list archives. I've found a small bug in the documentation, I > wanted to mention it since I think it should be changed accordingly. > > In

[sqlite] AUTOINCREMENT documentation.

2009-02-18 Thread Troeger, Thomas (ext)
Hello, Sorry if this has been asked before, I couldn't find any reference to it in the list archives. I've found a small bug in the documentation, I wanted to mention it since I think it should be changed accordingly. In http://www.sqlite.org/autoinc.html the documentation says: """ The normal

Re: [sqlite] AUTOINCREMENT detection

2008-06-16 Thread D. Richard Hipp
On Jun 16, 2008, at 4:42 AM, Csaba wrote: > Hi, I didn't get a response to my first post to this group > and I didn't get a copy, so perhaps it didn't go through... > > Is there any way to detect, based strictly on querying > the structure of a table/database whether there is an > AUTOINCREMENT

[sqlite] AUTOINCREMENT detection

2008-06-16 Thread Csaba
Hi, I didn't get a response to my first post to this group and I didn't get a copy, so perhaps it didn't go through... Is there any way to detect, based strictly on querying the structure of a table/database whether there is an AUTOINCREMENT set? That is to say, without analyzing the original

Re: [sqlite] autoincrement and fts2?

2007-07-18 Thread Joe Wilson
--- Scott Hess <[EMAIL PROTECTED]> wrote: > S, as far as I can tell, this behaviour changed in October, with > http://www.sqlite.org/cvstrac/chngview?cn=3470 . Which is before fts2 > even existed! So fts2 has been broken in this way essentially > forever. *sigh*. [I'm not entirely clear

Re: [sqlite] autoincrement and fts2?

2007-07-18 Thread Scott Hess
S, as far as I can tell, this behaviour changed in October, with http://www.sqlite.org/cvstrac/chngview?cn=3470 . Which is before fts2 even existed! So fts2 has been broken in this way essentially forever. *sigh*. [I'm not entirely clear why that change introduced this difference, but it

Re: [sqlite] autoincrement and fts2?

2007-07-17 Thread Scott Hess
[Forwarding gist of an offline conversation with Joe.] Looks about like what my patch looks like. Needs to additionally handle %_segments.rowid (same problem, but you need to insert more than 16 docs to see it). I'm also tossing in some test cases. My patch should be ready this afternoon.

Re: [sqlite] autoincrement and fts2?

2007-07-17 Thread Scott Hess
You can, and I'm working on a patch to do this to see how it might look. There's the question of how to handle existing tables. -scott On 7/17/07, Chris Wedgwood <[EMAIL PROTECTED]> wrote: On Tue, Jul 17, 2007 at 09:37:43AM -0700, Scott Hess wrote: > Summary: In sqlite 3.4, running vacuum

Re: [sqlite] autoincrement and fts2?

2007-07-17 Thread Joe Wilson
Scott, I've attached a possible patch to the ticket. It seems to work, but I may have missed some something. Tell me what you think. --- Scott Hess <[EMAIL PROTECTED]> wrote: > I've updated the bug with an example of how this breaks fts tables > (fts1 or fts2). I'm thinking on the problem. >

Re: [sqlite] autoincrement and fts2?

2007-07-17 Thread Scott Hess
I've updated the bug with an example of how this breaks fts tables (fts1 or fts2). I'm thinking on the problem. http://www.sqlite.org/cvstrac/tktview?tn=2510 Summary: In sqlite 3.4, running vacuum with fts2 or fts1 tables can break the table if you've done any deletions. I'll try to add more

Re: [sqlite] autoincrement and fts2?

2007-07-17 Thread Scott Hess
WTH! Wow, this is a very unexpected change. I must have not been paying attention at some point. -scott On 7/17/07, Ralf Junker <[EMAIL PROTECTED]> wrote: >>The standard way to have non-TEXT information associated with rows in >>an fts table would be a separate table which joins with the

Re: [sqlite] autoincrement and fts2?

2007-07-17 Thread Ralf Junker
>>The standard way to have non-TEXT information associated with rows in >>an fts table would be a separate table which joins with the fts table >>on rowid. > >I have not tested this, but if the FTS2 rowid is the standard SQLite rowid, I >believe that it will be affected by VACUUM change of

Re: [sqlite] autoincrement and fts2?

2007-07-17 Thread Ralf Junker
>The rowid is the standard SQLite rowid, so it does provide an INTEGER >PRIMARY KEY AUTOINCREMENT column. > >The standard way to have non-TEXT information associated with rows in >an fts table would be a separate table which joins with the fts table >on rowid. I have not tested this, but if the

Re: [sqlite] autoincrement and fts2?

2007-07-17 Thread Scott Hess
On 7/16/07, Adam Megacz <[EMAIL PROTECTED]> wrote: Is there any way to use a INTEGER PRIMARY KEY AUTOINCREMENT on a table that has FTS2? Specifying it in the obvious manner looks like it works, but the column just ends up with nulls in it. In fts tables all columns other than rowid are of

[sqlite] autoincrement and fts2?

2007-07-17 Thread Adam Megacz
Is there any way to use a INTEGER PRIMARY KEY AUTOINCREMENT on a table that has FTS2? Specifying it in the obvious manner looks like it works, but the column just ends up with nulls in it. - a -- PGP/GPG: 5C9F F366 C9CF 2145 E770 B1B8 EFB1 462D A146 C380

[sqlite] Autoincrement step size

2007-01-05 Thread mikpol
Hi Everyone, I would like to be able to change the step size of an AUTOINCREMENT rowid, so that it is incremented by some integer other than 1. The purpose is for database replication, for which I need rows of a table in two different databases to have non-overlapping rowid ranges. I have tried

Re: [sqlite] autoincrement and integer primary key

2006-11-16 Thread Mario Frasca
[EMAIL PROTECTED] wrote: In the FAQ's on the web site it indicated that when the primary key is autoincrement, the data type is a signed 64 bit number. Has this been your experience? never noticed... not in Python with the sqlite modules I have... and no difference whether I use the

  1   2   >