weixin_42906530
快乐的胖胖麦兜
采纳率100%
2018-12-18 22:48

Android Sqlite建表语句出错

//数据库建表
public static final String CREATE_USER_TABLE = "create table IF NOT EXISTS"
+ USER_TABLE + "("
+ _ID + " integer primary key autoincrement, "
+ USER_ID + " text, "
+ USER_NAME + " text, "
+ TOKEN + " text, "
+ TOKEN_SECRET + " text, "
+ DESCRIPTION + " text, "
+ USER_HEAD + " BLOB)";

                            出现错误了
                            android.database.sqlite.SQLiteException: near "EXISTSuserinfo": syntax error (code 1): , while compiling: create table IF NOT EXISTSuserinfo(_id integer primary key autoincrement, user_id text, user_name text, token text, token_secret text, description text, user_head BLOB)
  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

1条回答

  • come_on_Angelababy come_on_Angelababy 3年前

    public static final String CREATE_USER_TABLE = "create table IF NOT EXISTS "
    exists后面加个空格

    点赞 1 评论 复制链接分享

相关推荐