SQLite创建两个表出错

nwpucoder 2010-11-06 12:15:53
创建两个表出错,把语句合并在一起执行还是会报错
private static final String DATABASE_CREATE = "create table diary " +
"(_id integer primary key autoincrement, "
+ "title text not null, body text not null, created text not null, " +
"name text not null, start text not null, end text not null, " +
"index text not null, place text not null);";
/*
private static final String DATABASE_CREATE_COURSE = "create table course " +
"(_id integer primary key autoincrement, " +
"name text not null, start text not null, end text not null, index text not null, place text not null);";
*/

@Override
public void onCreate(SQLiteDatabase db) {
db.execSQL(DATABASE_CREATE);
//db.execSQL(DATABASE_CREATE_COURSE);
}

报错信息是
Failure 1 near "index" syntax error on 0x256e10 when preparing ‘crtete table diary....’

...全文
206 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
archko 2010-11-06
  • 打赏
  • 举报
回复
crtete table diary
上来错误要把里面的字写清楚了.

80,490

社区成员

发帖
与我相关
我的任务
社区描述
移动平台 Android
androidandroid-studioandroidx 技术论坛(原bbs)
社区管理员
  • Android
  • yechaoa
  • 失落夏天
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧