2

sqlite3の初心者。

私の理解が間違っている場合は私を訂正しますか?

sqlite3_open(ファイル名、&dbConnection)->

1) This API creates an database [ie: filename], if it does not exists, and sets
the context to dbConnection. 
2) If the database exists already it just sets the context to dbConnection. 

(1)と(2)のどちらの場合もSQLITE_OKを返します。

質問:データベースが最初に作成された場合にフィルタリングする可能性はありますか?

例:sqlite3_open(...)if(初めてデータベースを作成した){テーブルを作成}

1つの可能性はファイルの存在を確認することですが、私はそれをしたくありません。sqlite3自体からの代替方法はありますか?

4

1 に答える 1

0

そのための構文が存在しない場合は、createtableを使用できます。

Sqliteテーブルの作成

于 2012-09-28T05:13:23.000 に答える