tags:

views:

22

answers:

1

I get error near autoincrement syntax. Any help? :) Thanks!

create table Person(
ID integer not null autoincrement,
Name text not null
);

create table Department(
ID integer not null autoincrement,
Name text not null,
foreign key(Leader) references Person(ID)
);
+3  A: 

According to SQLite FAQ you have to declare either a INTEGER PRIMARY KEY or INTEGER PRIMARY KEY AUTOINCREMENT column to achieve that.

sharptooth
Thanks, missed it.
Serg