lundi 29 juin 2015

SQL Query in Android application adds unwanted extra Fileds

I have developed an application using android studio. In my code I have written an SQL Query in the developed android application. The SQL query seems to be correct but for Some reason, It adds an extra Filed to the Column name like below. As you can see asset_description table has the word "Text". As this should not be the case.

I do not know why this is happening

enter image description here

The Column names are as shown below

 //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";

This is the table creation section

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"+ ");";

Aucun commentaire:

Enregistrer un commentaire