當我創建新表,如:錯誤創建表sqllite(機器人)
private static final String SQL_CREATE_AREAS = "CREATE TABLE IF NOT EXISTS `cs_area` (" +
" `area_id` mediumint(6) NOT NULL AUTO_INCREMENT,"+
" `areaname` varchar(40) NOT NULL,"+
" PRIMARY KEY (`area_id`),"+
" KEY `areaname` (`areaname`)"+
") DEFAULT CHARSET=utf8 AUTO_INCREMENT=13 ;";
我得到錯誤:android.database.sqlite.SQLiteException:
所致附近 「AUTO_INCREMENT」 :語法錯誤(碼1):在編譯:CREATE TABLE IF NOT EXISTS
cs_area
(area_id
MEDIUMINT(6)NOT NULL AUTO_INCREMENT,areaname
VARCHAR(40)NOT NULL,PRIMARY KEY (area_id
),密鑰areaname
(areaname
))DEFAULT CHARSET = utf8 AUTO_INCREMENT = 13;
也許,任何人都可以幫助我?謝謝
這是在sqlite的表? – 2013-04-10 22:12:06