public void onCreate(SQLiteDatabase db) {
// TODO Auto-generated method stub
String ProjectDetailTable = "CREATE TABLE " + TABLE_PROJECT_DETAIL + "("
+ ProjectID + " INTEGER PRIMARY KEY AUTOINCREMENT," + ProjectName + " VARCHAR," + Budget + " VARCHAR," + Duration + " VARCHAR," + StartDate+ " VARCHAR," + ProjectDescription+ " VARCHAR)";
String ExpensesTable = " CREATE TABLE " + TABLE_PROJECT_EXPENSES + "("+ExpensesID+"INTEGER PRIMARY KEY AUTOINCREMENT,"+ExpProjectName+"VARCHAR,"
+Date +"VARCHAR,"+ExpensesTitle+"VARCHAR,"+ExpensesAmount+"VARCHAR,"+ExpDescription+"VARCHAR)";
db.execSQL(ProjectDetailTable);
db.execSQL(ExpensesTable);
}
答案 0 :(得分:1)
在Column Name
和Column Type
String ExpensesTable = " CREATE TABLE " + TABLE_PROJECT_EXPENSES + "("+ExpensesID+" INTEGER PRIMARY KEY AUTOINCREMENT,"+ExpProjectName+" VARCHAR,"
+Date +" VARCHAR,"+ExpensesTitle+" VARCHAR,"+ExpensesAmount+" VARCHAR,"+ExpDescription+" VARCHAR)";
答案 1 :(得分:0)
在第二个查询中在字段名称和字段类型之间添加空格。
String ExpensesTable = " CREATE TABLE " + TABLE_PROJECT_EXPENSES + " ( "+ExpensesID+" INTEGER PRIMARY KEY AUTOINCREMENT,"+ExpProjectName+" VARCHAR,"
+Date +" VARCHAR,"+ExpensesTitle+" VARCHAR,"+ExpensesAmount+" VARCHAR,"+ExpDescription+" VARCHAR)";