0
我在我的SQLite中創建一個四行表時出現語法錯誤,我不知道爲什麼。這是我的代碼。創建表語法錯誤SQLite
private static final String TABLE_PRIMERO = "jugadors";
// Jugadors Table Columns names
private static final String KEY_ID = "id";
private static final String KEY_NAME = "name";
private static final String KEY_ALTURA = "altura";
private static final String KEY_PARTIDO = "partido";
int oldVersion=1;
public DatabaseHandler(Context context) {
super(context, DATABASE_NAME, null, DATABASE_VERSION);
}
// Creating Tables
@Override
public void onCreate(SQLiteDatabase db) {
String CREATE_JUGADORS_TABLE1 = "CREATE TABLE_PRIMERO " + TABLE_PRIMERO + "("
+ KEY_ID + " INTEGER PRIMARY KEY,"
+ KEY_NAME + " TEXT,"
+ KEY_ALTURA + " TEXT,"
+ KEY_PARTIDO + " TEXT"
+ ")";
db.execSQL(CREATE_JUGADORS_TABLE1);
}
//Upgrading database
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
// Drop older table if existed
db.execSQL("DROP TABLE IF EXISTS " + TABLE_PRIMERO);
// Create tables again
onCreate(db);
}
我不知道我在做什麼錯。
在此先感謝。