Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用创建表,create table ... (sqlite3_open() and sqlite3_exec())但我不知道我们如何知道数据库文件是否已创建。
create table ... (sqlite3_open() and sqlite3_exec())
有两种方法可以检查:
1)您可以在创建这样的表时直接检查:
create table if not exists TableName
2)您可以在创建表之前检查表是否已经存在,如下所示:
SELECT name FROM sqlite_master WHERE type='table' AND name='table_name';