我使用android studio开发了一个应用程序。在我的代码中,我在开发的android应用程序中编写了一个SQL查询。 SQL查询似乎是正确的但由于某些原因,它会向列名称添加额外的Filed,如下所示。正如您所看到的,asset_description表中包含单词" Text"。因为情况不应该如此。
我不知道为什么会发生这种情况
列名如下所示
//Columns in the Asset Table
public static final String ASSET_ID = "Assetid";
public static final String ASSET_Name="asset_name";
public static final String ASSET_Category ="category";
public static final String ASSET_PurchaseDate = "Purchase_date";
public static final String Asset_Cost ="Asset_cost";
public static final String ASSET_STATUS ="asset_status";
public static final String ASSET_DESCRIPTION ="assets_description";
public static final String ASSET_Warrenty ="warrenty";
这是表格创建部分
private static final String CREATE_TABLE_ASSET ="CREATE TABLE" + TABLE_ASSET + "("
+ ASSET_ID + " INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,"
+ ASSET_Name + " TEXT NOT NULL,"
+ ASSET_Category +" TEXT NOT NULL,"
+ CUSTODIAN_ID + " TEXT NOT NULL,"
+ Asset_Cost + " DOUBLE NOT NULL,"
+ ASSET_PurchaseDate + " DATE NULL,"
+ ASSET_STATUS +" TEXT NOT NULL,"
+ ASSET_DESCRIPTION + "Text NOT NULL,"
+ ASSET_Warrenty +" DATE NOT NULL"+ ");";
答案 0 :(得分:1)
您错过了一个空格:
+ ASSET_DESCRIPTION + " TEXT NOT NULL,"