I am trying to work on some Android database/ sql stuff and have run into a snag. I am getting some errors and rather than pasting in an enormous chunk of code here, I thought I would narrow the question a bit. I was following the second response in this thread:
Creating tables in sqlite database on android
And noticed that they used the "INTEGER" type for defining the column.
public void onCreate(SQLiteDatabase db) {
// TODO Auto-generated method stub
db.execSQL(" CREATE TABLE " + DATABASE_MARKSTABLE + " (" +
KEY_STUID + " TEXT PRIMARY KEY, " +
KEY_SUB1 + " TEXT NOT NULL, " +
KEY_SUB2 + " TEXT NOT NULL, " +
KEY_SUB3 + " TEXT NOT NULL, " +
KEY_MARKS1 + " **INTEGER** NOT NULL, " +
KEY_MARKS2 + " **INTEGER** NOT NULL, " +
KEY_MARKS3 + " **INTEGER** NOT NULL);"
);
}
My database will be using dollar amounts and percentages, meaning I will need decimal places. My question is, can you use the definition of DOUBLE here? Will it work? Is there a better option like FLOAT?
The only reason I don't just try this in code is that my pile of errors may mask the underlying issue and I might get a wrong answer.