由网友(沽酒杯空影)分享简介:我谨数据库创建Applcation.onCreate表SqliteHelper.onCreate。I move database create table from Applcation.onCreate to SqliteHelper.onCreate.在应用程序中,我必须检查表已经存在。但在SqliteHelp...
我谨数据库创建Applcation.onCreate表SqliteHelper.onCreate。
I move database create table from Applcation.onCreate to SqliteHelper.onCreate.
在应用程序中,我必须检查表已经存在。但在SqliteHelper,因为它呼吁建立数据库文件,我不认为这是nessasary使用IF NOT EXISTS
In Application, I must check if table already exists. But in SqliteHelper, as it's called on creation of database file, I don't think it's nessasary to use "IF NOT EXISTS"
CREATE TABLE {TABLE_NAME} IF NOT EXISTS (_id bla bla);
我可以改变这个SQL下?
Can I change this sql to below?
CREATE TABLE {TABLE_NAME} (_id bla bla)
编辑---------
EDIT ---------
我问,如果SqliteHelper.onCreate可以多次调用。
I asked if SqliteHelper.onCreate can called several times.
推荐答案
当然可以。但是,第一种方法是一直鼓励!
Yes you can. But the first method is always encouraged!
相关推荐
最新文章