0

I'm creating a table like this

// Required variables for Collection table
    private static final String TABLE_COLLECTION = "collection";
    private static final String KEY_TIME = "time";
    private static final String KEY_CUSTOMER_ID = "cust_id";
    private static final String KEY_AMOUNT = "amount";
    private static final String KEY_CHEQ_NO = "cheq_no";
    private static final String KEY_LATITUDE = "latitude";
    private static final String KEY_LONGTITUDE = "longtitude";

String CREATE_COLLECTION_TABLE = "CREATE TABLE " + TABLE_COLLECTION
                + "(" + KEY_TIME + " TEXT PRIMARY KEY, " + KEY_CUSTOMER_ID
                + " TEXT, " + KEY_AMOUNT + " INTEGER, " + KEY_CHEQ_NO + " INTEGER, " + KEY_LATITUDE + " REAL, " + KEY_LONGTITUDE + " REAL)";

But when I execute the following query, it says there's no such column named latitude.

String INSERT_QUERY = "INSERT INTO " + TABLE_COLLECTION + "(" + KEY_TIME + ", " + KEY_CUSTOMER_ID + ", " + KEY_AMOUNT + ", " + KEY_CHEQ_NO + ", " + KEY_LATITUDE + ", " + KEY_LONGTITUDE + ") VALUES ('" + time + "', '" + cust_id + "', " + amount + ", " + cheq_no + ", " + lat + ", " + lon + ")";

P.S:Tried ContentValues, but it also gives the same exception.

We're All Mad Here
  • 1,544
  • 3
  • 18
  • 46
Thahzan
  • 975
  • 2
  • 9
  • 23

0 Answers0