Hi,

I think you should insert the real value you need (516, 517,etc...) instead
of NULL. sqlite autoincrement means if NULL inserted it checks the last
value and inserts the next.
I hope it will help.

----- Original Message -----
From: "Keith Herold" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, April 05, 2004 11:01 PM
Subject: [sqlite] Setting Autoincrement


Hi folks;  is there a way to set an INTEGER PRIMARY KEY to a predetermined
value, so that all subsequent inserts have the correct autoincrement value?


I have an in-memory db that periodically writes to a disk db (there are good
reasons for this).  Later, I may need a connection to that disk db via
another memory db, but any inserts from that connection need to take place
at the appropriate autoincrement value.  So, suppose I last wrote to the
disk db and ended at autoincrement = 514 .  Later, I reconnect, but need the
new in-memory db to start incrementing inserts at 515, 516, etc., so that
the eventual write to the disk db is synchronized correctly (I will not be
hitting the upper limit on rows, so I am not worrying about reusing
autoincrements).

I can, of course, just do the autoincrement myself, but I would prefer to
let SQLite continue to handle that.

Any ideas?

--Keith


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to