):SQL建表错误
SQL错误,求教db.execSQL("CREATETABLEperson(personidintegerprimarykeyautoincrement,namevarc...
SQL错误,求教 db.execSQL("CREATE TABLE person(personid integer primary key autoincrement,name varchar(20),phone varchar(12),check varchar(12))");
04-24 10:06:43.907: E/AndroidRuntime(26166): FATAL EXCEPTION: main
04-24 10:06:43.907: E/AndroidRuntime(26166): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.counting/com.example.counting.counting}: android.database.sqlite.SQLiteException: near "varchar": syntax error (code 1): , while compiling: CREATE TABLE person(personid integer primary key autoincrement,name varchar(20),phone varchar(12),check varchar(12))
04-24 10:06:43.907: E/AndroidRuntime(26166): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2180)
04-24 10:06:43.907: E/AndroidRuntime(26166): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
04-24 10:06:43.907: E/AndroidRuntime(26166): at android.app.ActivityThread.access$600(ActivityThread.java:141)
04-24 10:06:43.907: E/AndroidRuntime(26166): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
04-24 10:06:43.907: E/AndroidRuntime(26166): at android.os.Handler.dispatchMessage(Handler.java:99)
04-24 10:06:43.907: E/AndroidRuntime(26166): at android.os.Looper.loop(Looper.java:137)
04-24 10:06:43.907: E/AndroidRuntime(26166): at android.app.ActivityThread.main(ActivityThread.java:5041) 展开
04-24 10:06:43.907: E/AndroidRuntime(26166): FATAL EXCEPTION: main
04-24 10:06:43.907: E/AndroidRuntime(26166): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.counting/com.example.counting.counting}: android.database.sqlite.SQLiteException: near "varchar": syntax error (code 1): , while compiling: CREATE TABLE person(personid integer primary key autoincrement,name varchar(20),phone varchar(12),check varchar(12))
04-24 10:06:43.907: E/AndroidRuntime(26166): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2180)
04-24 10:06:43.907: E/AndroidRuntime(26166): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
04-24 10:06:43.907: E/AndroidRuntime(26166): at android.app.ActivityThread.access$600(ActivityThread.java:141)
04-24 10:06:43.907: E/AndroidRuntime(26166): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
04-24 10:06:43.907: E/AndroidRuntime(26166): at android.os.Handler.dispatchMessage(Handler.java:99)
04-24 10:06:43.907: E/AndroidRuntime(26166): at android.os.Looper.loop(Looper.java:137)
04-24 10:06:43.907: E/AndroidRuntime(26166): at android.app.ActivityThread.main(ActivityThread.java:5041) 展开
1个回答
展开全部
mysql?
CREATE TABLE person(personid int not null primary key AUTO_INCREMENT,
`name` varchar(20),
phone varchar(12),
`check` varchar(12))
这样试试
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
网易云信
2023-12-06 广告
2023-12-06 广告
UIkit是一套轻量级、模块化且易于使用的开源UI组件库,由YOOtheme团队开发。它提供了丰富的界面元素,包括按钮、表单、表格、对话框、滑块、下拉菜单、选项卡等等,适用于各种类型的网站和应用程序。UIkit还支持响应式设计,可以根据不同...
点击进入详情页
本回答由网易云信提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询