'(', ')',<列约束>或预期逗号,得到“INTEGER”列约束>
我正在尝试使用 SQLite 编写我的第一个 Kotlin 应用程序,这是有问题的部分:
override fun onCreate(p0: SQLiteDatabase?) {
p0!!.execSQL("CREATE TABLE IF NOT EXISTS $CAR_TABLE(" +
"$CAR_ID INTEGER PRIMARY KEY AUTOINCREMENT, $CAR_NAME TEXT," +
"$CAR_COLOR TEXT, $CAR_MODEL INTEGER)")
我遇到此错误消息:
'(', ')', or comma Expected, got 'INTEGER '
有趣的是,如果我像这样删除最后一部分:
override fun onCreate(p0: SQLiteDatabase?) {
p0!!.execSQL("CREATE TABLE IF NOT EXISTS $CAR_TABLE(" +
"$CAR_ID INTEGER PRIMARY KEY AUTOINCREMENT, $CAR_NAME TEXT," +
"$CAR_COLOR TEXT)")
不会有任何错误消息。你能帮我吗?
Android Studio“大黄蜂”。 先感谢您
I am trying to write my first Kotlin app using SQLite and here is the problematic part:
override fun onCreate(p0: SQLiteDatabase?) {
p0!!.execSQL("CREATE TABLE IF NOT EXISTS $CAR_TABLE(" +
"$CAR_ID INTEGER PRIMARY KEY AUTOINCREMENT, $CAR_NAME TEXT," +
"$CAR_COLOR TEXT, $CAR_MODEL INTEGER)")
I am facing this error message:
'(', ')', or comma expected, got 'INTEGER'
interestingly enough if I delete the last part like this:
override fun onCreate(p0: SQLiteDatabase?) {
p0!!.execSQL("CREATE TABLE IF NOT EXISTS $CAR_TABLE(" +
"$CAR_ID INTEGER PRIMARY KEY AUTOINCREMENT, $CAR_NAME TEXT," +
"$CAR_COLOR TEXT)")
there won't be any error messages. Could you help me with it please?
Android Studio "Bumblebee".
Thank you in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论