标签:
void select_by_prepare (sqlite3* pDB){
51 int i;
52 int ret = 0;
53 int time;
54 char* pdu;
55 int pdu_size;
56 int flag;
57 sqlite3_stmt *statement;
58
59 ret = sqlite3_prepare (pDB, "SELECT * FROM content", -1, &statement, NULL);
60 if(ret != SQLITE_OK){
61 printf("prepare error ret : %d\n", ret);
62 return;
63 }
64
65 while (sqlite3_step(statement) == SQLITE_ROW) {
66 time = sqlite3_column_int(statement, 0);
67 pdu = (char *)sqlite3_column_text(statement, 1);
68 pdu_size = sqlite3_column_int (statement, 2);
69 flag = sqlite3_column_int (statement, 3);
70
71 printf("step row num : %d, %s, %d, %d\n", time, pdu, pdu_size, flag);
72 }
73
74 sqlite3_finalize(statement);
75 }
sqlite3 sqlite3_prepare、sqlite3_step使用
标签:
原文地址:http://www.cnblogs.com/hushaojun/p/5261334.html