我无法从SQLite中的scheme文件导入数据库

时间:2014-02-14 20:12:08

标签: database sqlite

drop table if exists libuser;

create table libuser (
  id integer primary key,
  name string not null,
  fname string not null,
);

我得到了:

kasimov$ sudo sqlite3 library.db < scheme.sql

Error: near line 2: near ")": syntax error

我不知道!

1 个答案:

答案 0 :(得分:0)

fname声明后有一个额外的逗号,导致错误。尝试:

drop table if exists libuser;
create table libuser (id integer primary key, 
                      name string not null, 
                      fname string not null);