Android编程中如何在一个SQLite数据库创建两个表?
我这样可以在SQLite数据库中建立两个表么publicvoidonCreate(SQLiteDatabaseourdatabase){//TODO自动生成的方法存根ou...
我这样可以在SQLite数据库中建立两个表么
public void onCreate(SQLiteDatabase ourdatabase) {
// TODO 自动生成的方法存根
ourdatabase.execSQL("CREATE TABLE " + TABLE_NAME1
+ " (_id INTEGER PRIMARY KEY AUTOINCREMENT,"
+ ID + " TEXT,"
+ MARCHAT_NAME + " TEXT,"
+ MARCHAT_PRICE + " TEXT);");
ourdatabase.execSQL("CREATE TABLE " + TABLE_NAME2
+ " (_id2 INTEGER PRIMARY KEY AUTOINCREMENT,"
+ Con_ID + " TEXT,"
+ Consumer_NAME + " TEXT,"
+ Consumer_SUM + " TEXT);");
} 展开
public void onCreate(SQLiteDatabase ourdatabase) {
// TODO 自动生成的方法存根
ourdatabase.execSQL("CREATE TABLE " + TABLE_NAME1
+ " (_id INTEGER PRIMARY KEY AUTOINCREMENT,"
+ ID + " TEXT,"
+ MARCHAT_NAME + " TEXT,"
+ MARCHAT_PRICE + " TEXT);");
ourdatabase.execSQL("CREATE TABLE " + TABLE_NAME2
+ " (_id2 INTEGER PRIMARY KEY AUTOINCREMENT,"
+ Con_ID + " TEXT,"
+ Consumer_NAME + " TEXT,"
+ Consumer_SUM + " TEXT);");
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询