Re: [sqlite] Can primary key columns be altered to use autoincrement?

2006-11-03 Thread Jay Sprenkle

On 11/2/06, Rob Richardson <[EMAIL PROTECTED]> wrote:

I have a small database in which tables have columns that were created
as integer primary key, but not autoincrement.  I would like to make
sure keys are never reused, so I want to add autoincrement to the column
definition.  Is that possible?

As near as I could tell from the docs, it's not possible to alter a
column at all.  There's no ALTER COLUMN clause available for the ALTER
TABLE statement.  Is that correct?



Create a new database with the proper attributes and copy your data to it.
Then swap the old one out and replace it with the new one.


--
SqliteImporter and SqliteReplicator: Command line utilities for Sqlite
http://www.reddawn.net/~jsprenkl/Sqlite

Cthulhu Bucks!
http://www.cthulhubucks.com

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Can primary key columns be altered to use autoincrement?

2006-11-02 Thread Rich Shepard

On Thu, 2 Nov 2006, Rob Richardson wrote:


I have a small database in which tables have columns that were created as
integer primary key, but not autoincrement.  I would like to make sure
keys are never reused, so I want to add autoincrement to the column
definition.  Is that possible?


Rob,

  I have tables with the first column defined as 'integer primary key' and
the key values are entered and automatically incremented when I add records.

  When you add the record(s), specify fields and values _exclusive_ of the
first (key) column. However, if you're importing data from an ASCII text (or
CSV) file, then you need to include the key values yourself.

Rich

--
Richard B. Shepard, Ph.D.   |The Environmental Permitting
Applied Ecosystem Services, Inc.(TM)|Accelerator
 Voice: 503-667-4517  Fax: 503-667-8863

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



[sqlite] Can primary key columns be altered to use autoincrement?

2006-11-02 Thread Rob Richardson
I have a small database in which tables have columns that were created
as integer primary key, but not autoincrement.  I would like to make
sure keys are never reused, so I want to add autoincrement to the column
definition.  Is that possible?  

As near as I could tell from the docs, it's not possible to alter a
column at all.  There's no ALTER COLUMN clause available for the ALTER
TABLE statement.  Is that correct?

Thank you.

Rob Richardson
RAD-CON INC.

-
To unsubscribe, send email to [EMAIL PROTECTED]
-