On 24/07/2009 3:10 PM, Simon Slavin wrote:
> On 24 Jul 2009, at 5:49am, John Machin wrote:
>
>> On 24/07/2009 3:22 AM, Simon Slavin wrote:
>>
>>> And note that if you have a column which is an integer that
>>> has doesn't allow duplicates, SQLite will automatically use that
>>> column as the one it uses for _rowid_, etc.. So define your own
>>> integer column, feed it whatever integers you want, and you won't
>>> waste any space.
>> Documentation reference, please.
>
> I'm sorry. I think that instead of 'integer unique' what I meant was
> 'autoincrement'. It's in the section of the documentation about row
> ids. I can't get at the web right now.
Perhaps not:
sqlite> create table bar(x text, y integer autoincrement);
SQL error: near "autoincrement": syntax error
sqlite> create table bar(x text, y autoincrement);
SQL error: near "autoincrement": syntax error
In any case 'autoincrement' doesn't correlate with "feed it whatever
integers you want".
Perhaps you meant 'integer primary key':
sqlite> create table bar(x text, y integer primary key);
sqlite> insert into bar values('aaa', 1);
sqlite> insert into bar values('bbb', 42);
sqlite> insert into bar values('ccc', 666);
sqlite> select rowid, * from bar;
1|aaa|1
42|bbb|42
666|ccc|666
sqlite>
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users