#include
#include
#include
#include
int print(void* para, int columncount, char **columnvalue, char **columnname) //由使用者處理查詢的結果
printf("\n");
return0;}
int main()
; char name[20] = ;
int id;
char ***;
ret = sqlite3_open("student.db", &ppdb); //開啟乙個資料庫;若該資料庫檔案不存在,則自動建立。開啟或者建立資料庫的命令會被快取,直到這個資料庫真正被呼叫的時候才會被執行
if (ret != sqlite_ok)
sprintf(sql, "create table if not exists student (name text, id integer, *** text);");
//把格式化的資料寫入sql字串緩衝區
ret = sqlite3_exec(ppdb, sql, null, null, null); //編譯和執行零個或多個sql 語句
if (ret != sqlite_ok)
for (i = 0; i < 3; i++)
memset(name, 0, sizeof(name));
}sprintf(sql, "select * from student;");
ret = sqlite3_exec(ppdb, sql, print, null, null);
if (ret != sqlite_ok)
return
0;}
嵌入式資料庫sqlite
自虛擬神話 也許往往大家是不需要像mysql sqlserver這類在複雜的資料庫,那麼sqlite 值得你去嘗試下!什麼是 sqlite sqlite 是一款輕量級的 基於檔案的嵌入式資料庫,2000年就已經誕生,經過多年的發展,直到今天已經成為最流行的,包括google在內的公司在其桌面軟體中亦...
嵌入式資料庫sqlite
自虛擬神話 也許往往大家是不需要像mysql sqlserver這類在複雜的資料庫,那麼sqlite值得你去嘗試下!什麼是 sqlite sqlite 是一款輕量級的 基於檔案的嵌入式資料庫,2000年就已經誕生,經過多年的發展,直到今天已經成為最流行的,包括google在內的公司在其桌面軟體中亦使...
嵌入式資料庫(二)
一 常量 也稱為literals,表示確切的值,有3種 字串常量 資料常量和二進位制常量。字串常量如 jerry newman jujyfruit 資料常量 數字常量有整數 十進位制數和科學記數法表示的數,如 1 3.142 6.0221415e23 二進位制值用如x 0000 的表示法,其中每個資...