J. R. Westmoreland <[email protected]> wrote:
> I have the following table creation statements and get an error.
>
> Functioning statement
>
> CREATE TABLE xxx (ID INTEGERPRIMARY KEY AUTOINCREMENT, .)
>
> If I remove the PRIMARY KEY" part of the statement, according to the
> docs on SQL that should be still a valid statement, I get an error.
>
> Brken statement:
>
> CREATE TABLE zzz (ID INTEGER AUTOINCREMENT .);

SQLite only supports AUTOINCREMENT together with PRIMARY KEY. See

http://sqlite.org/lang_createtable.html

> But, if I change "AUTOINCREMENT  "AUTO_INCREMENT" it works
>
> Functioning statement:
>
> CREATE TABLE zzz (ID INTEGER AUTO_INCREMENT .);

AUTO_INCREMENT has no special meaning in the syntax. It works for the 
same reason this works:

CREATE TABLE zzz (ID WHATEVER I WANT);

Neither makes ID an autoincrement field.

Igor Tandetnik 



_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to