intDB::ireturn_multi_serch(char*sql,int r,int c){char*errMsg;char**dbResult;int nRow=0,nColumn=0;int rc;int result;rc=sqlite3_get_table(db,sql,&dbResult,&nRow,&nColumn,&errMsg);if(rc==SQLITE_OK&&r<=nRow&&r>0&&c<
sqlite3_get_table函数原型: intsqlite3_get_table( sqlite3*db,/*An open database*/constchar*zSql,/*SQL to be evaluated*/char***pazResult,/*Results of the query*/int*pnRow,/*Number of result rows written here*/int*pnColumn,/*Number of result columns written here*/char**pzErrmsg/*Err...
这可以通过sqlite3_get_table 函数做到。 1intsqlite3_get_table(2sqlite3 *db,/*An open database*/3constchar*zSql,/*SQL to be evaluated*/4char***pazResult,/*Results of the query*/5int*pnRow,/*Number of result rows written here*/6int*pnColumn,/*Number of result columns written here*...
下面比如我们要显示student表中所有的数据信息,我们就可以利用sqlite3_get_table()执行语句: select * from student 实现代码如下: void do_show_sample(sqlite3 *db) { char **result, *errmsg; int nrow, ncolumn, i, j, index; if (sqlite3_get_table(db, "select * from student", &result, &nro...
和sqlite3_exec()这种使用回调函数的方式不同,sqlite3_get_table()的功能要显得更加直接。它通过控制语句的传入,直接将参数赋值给指针传出。来看一下函数原型: #include<sqlite3.h>intsqlite3_get_table(sqlite3* db,char* order,char* **dResult,int*nRow,int*nColnm,char**errmsg);//参数释义/* ...
int sqlite3_get_table( sqlite3 *db, /* An open database */ const char *zSql, /* SQL to be evaluated */ char ***pazResult, /* Results of the query */ int *pnRow, /* Number of result rows written here */ int *pnColumn, /* Number of result columns written here */ ...
intDB::ireturn_multi_serch(char*sql,intr,intc){char*errMsg;char**dbResult;intnRow=0,nColumn=0;intrc;intresult;rc=sqlite3_get_table(db,sql,&dbResult,&nRow,&nColumn,&errMsg);if(rc==SQLITE_OK&&r<=nRow&&r>0&&c<=nColumn&&c>0){result=atoi(dbResult[r*nColumn+c-1]);sqlite3_free...
和sqlite3_exec()这种使用回调函数的方式不同,sqlite3_get_table()的功能要显得更加直接。它通过控制语句的传入,直接将参数赋值给指针传出。来看一下函数原型: #include<sqlite3.h> intsqlite3_get_table(sqlite3*db,char*order,char***dResult,int*nRow,int*nColnm,char**errmsg); ...
排序是在你的SQL语句中进行的,如SELECT ... ORDER BY ctime,sqlite3_get_table只是获取你sql语句的执行结果,得到一个一维数组,先记录字段名 接下来为字段的值 可以
sqlite3_get_table 使用举例 void GetTable() { sqlite3 * db; int result; char * errmsg = NULL; char **dbResult; //是 char ** 类型,两个*号 int nRow, nColumn; int i , j; int index; result = sqlite3_open( “c:\\Dcg_database.db ”, db ); if( result != SQLITE_OK ) { ...