http://sqlfiddle.com/#!5/5cb3a/1
我使用android sqlite,所以我使用db.execsql()形式的非格式化的sql;
我已将问题缩小到了一线:
INSERT INTO pains (painlocation VARCHAR , painlevel INT(1) , starttime VARCHAR , endtime VARCHAR , symptoms VARCHAR , triggers VARCHAR , medications VARCHAR , othertreatments VARCHAR , notes VARCHAR) VALUES (Eyes , 8 , 12:00 , 12:01 , None , Eyes, None, None , None);
请帮帮我。每次它只是在android控制台中说出来,无论检查多少错误并阻止我输入的代码,我总是得到错误。:
Caused by: android.database.sqlite.SQLiteException: near "VARCHAR": syntax error (code 1): , while compiling: INSERT INTO pains (painlocation VARCHAR , painlevel INT(1) , starttime VARCHAR , endtime VARCHAR , symptoms VARCHAR , triggers VARCHAR , medications VARCHAR , othertreatments VARCHAR , notes VARCHAR) VALUES (Eyes , 8 , 12:00 , 12:01 , None , Eyes, None, None , None);