我非常有信心我已经正确设置了格式,因为它基本上与我正在使用的另一条语句完全相同(效果很好),但是我收到一条错误消息,指出
'(', ')' <column constraint> or comma expected, got 'TEXT'
并在“ TEXT”下的红色下划线:
+ RecentfileWaypointContract.Columns.RECENT_file_WAYPOINT_CONTRol_NUMBER + " TEXT NOT NulL, "
就像我说的那样,我基本上可以将此声明复制到其他地方.
这是行不通的:
String ssql; ssql = "CREATE table " + RecentfileWaypointContract.table_name + " (" + RecentfileWaypointContract.Columns._ID + " INTEGER PRIMARY KEY NOT NulL, " + RecentfileWaypointContract.Columns.RECENT_file_WAYPOINT_CONTRol_NUMBER + " TEXT NOT NulL, " + RecentfileWaypointContract.Columns.RECENT_file_WAYPOINT_INSURED_name + " TEXT NOT NulL, " + RecentfileWaypointContract.Columns.RECENT_file_WAYPOINT_CUSTOMER + " TEXT NOT NulL, " + RecentfileWaypointContract.Columns.RECENT_file_WAYPOINT_ADDRESS1 + " TEXT NOT NulL, " + RecentfileWaypointContract.Columns.RECENT_file_WAYPOINT_ADDRESS2 + " TEXT, " + RecentfileWaypointContract.Columns.RECENT_file_WAYPOINT_CITY + " TEXT NOT NulL, " + RecentfileWaypointContract.Columns.RECENT_file_WAYPOINT_STATE + " TEXT NOT NulL, " + RecentfileWaypointContract.Columns.RECENT_file_WAYPOINT_ZIPCODE + " TEXT NOT NulL);"; db.execsql(ssql);
为了进行比较,下面的方法效果很好:
String ssql; ssql = "CREATE table " + UserWaypointContract.table_name + " (" + UserWaypointContract.Columns._ID + " INTEGER PRIMARY KEY NOT NulL, " + UserWaypointContract.Columns.USER_WAYPOINT_Title + " TEXT NOT NulL, " + UserWaypointContract.Columns.USER_WAYPOINT_ADDRESS1 + " TEXT NOT NulL, " + UserWaypointContract.Columns.USER_WAYPOINT_ADDRESS2 + " TEXT, " + UserWaypointContract.Columns.USER_WAYPOINT_CITY + " TEXT NOT NulL, " + UserWaypointContract.Columns.USER_WAYPOINT_STATE + " TEXT NOT NulL, " + UserWaypointContract.Columns.USER_WAYPOINT_ZIPCODE + " TEXT NOT NulL);"; db.execsql(ssql);
(此外,有两个不同的类,因此在两个地方使用ssql都不是问题)
有任何想法吗?
解决方法:
您不能在其中包含空格的列名称.用“ Control_number”,“ ControlNumber”,“ controlNumber”或类似名称替换“ Control number”.
总结以上是内存溢出为你收集整理的栏目约束或逗号,得到TEXT全部内容,希望文章能够帮你解决栏目约束或逗号,得到TEXT所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)