You could also define your primary key as INT PRIMARY KEY (rather than
INTEGER PRIMARY KEY) and in that case SQLite will treat it as a normal
column and it will remain immutable over time (unless you change it).
However, I would advise against using INT PRIMARY KEY inasmuch as this
subtle (yet documented) difference between INT and INTEGER in primary keys
in SQLite has already been a cause of significant confusion and is an
"accident waiting to happen" IMO since not all implementations of SQLite may
be hep to the nuance.  What you want is a simple ersatz value for the entity
 (i.e. an "alternate unique key"); a second column which *explicitly* acts
in this manner will be clearer.
Regards
Tim Romano
Swarthmore PA


On Mon, Jun 28, 2010 at 8:43 AM, Tim Romano <tim.romano...@gmail.com> wrote:

> And myspecialvalue can be INTEGER|TEXT.
>
>
> On Mon, Jun 28, 2010 at 8:39 AM, Tim Romano <tim.romano...@gmail.com>wrote:
>
>> In this example:
>>
>> CREATE TABLE  tableA {
>>
>>   id INTEGER PRIMARY KEY AUTOINCREMENT,
>>  name TEXT NOT NULL UNIQUE,
>>   myspecialvalue TEXT NOT NULL UNIQUE
>> }
>>
>>
>>
>>
>
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to