public void onCreate(SQLiteDatabase db) {
// TODO Auto-generated method stub
db.execSQL("CREATE TABLE " + DATABASE_TABLE_COURSES + " ("
+ KEY_ROWID + " INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "
+ KEY_COURSE_ID + " TEXT NOT NULL, "
+ KEY_COURSE_TITLE + " TEXT NOT NULL, "
+ KEY_COURSE_CNUMBER + " TEXT NOT NULL, "
+ KEY_COURSE_SUBJECT + " TEXT NOT NULL, "
+ KEY_COURSE_DAYS + " TEXT NOT NULL, "
+ KEY_COURSE_START_TIME + " TEXT NOT NULL, "
+ KEY_COURSE_END_TIME + " TEXT NOT NULL, "
+ KEY_COURSE_PROFESSOR + " TEXT NOT NULL, "
+ KEY_COURSE_BUILDING + " TEXT NOT NULL, "
+ KEY_COURSE_ROOM_NUMBER + " TEXT NOT NULL);");
我想检查 course_id 是否已经存在于表中,然后不要再输入。谢谢