Lines Matching refs:pStmt
913 sqlite3_stmt *pStmt = 0;
923 sqlite3_prepare_v2(db, zSql, -1, &pStmt, 0);
934 while( sqlite3_step(pStmt)==SQLITE_ROW ){
935 const char *zCol = (const char*)sqlite3_column_text(pStmt, 1);
944 sqlite3_finalize(pStmt);
2115 sqlite3_stmt *pStmt = 0;
2137 rc = sqlite3_prepare_v2(db, zSql, -1, &pStmt, &zSql);
2141 sqlite3_finalize(pStmt);
2146 if( !sqlite3_stmt_readonly(pStmt) ){
2147 char *zMsg = sqlite3_mprintf("non-query: [%s]", sqlite3_sql(pStmt));
2148 sqlite3_finalize(pStmt);
2153 nCol = sqlite3_column_count(pStmt);
2154 z = sqlite3_sql(pStmt);
2162 while( SQLITE_ROW==sqlite3_step(pStmt) ){
2165 switch( sqlite3_column_type(pStmt,i) ){
2174 sqlite3_int64 v = sqlite3_column_int64(pStmt,i);
2188 double r = sqlite3_column_double(pStmt,i);
2199 int n2 = sqlite3_column_bytes(pStmt, i);
2200 const unsigned char *z2 = sqlite3_column_text(pStmt, i);
2206 int n2 = sqlite3_column_bytes(pStmt, i);
2207 const unsigned char *z2 = sqlite3_column_blob(pStmt, i);
2215 sqlite3_finalize(pStmt);
5728 sqlite3_stmt *pStmt; /* Current statement */
5828 sqlite3_finalize(pCur->pStmt); pCur->pStmt = 0;
5844 ** The ->ePhase, ->j, and ->pStmt fields of the completion_cursor object
5858 int iCol = -1; /* If >=0, step pCur->pStmt and use the i-th column */
5873 if( pCur->pStmt==0 ){
5875 &pCur->pStmt, 0);
5882 if( pCur->pStmt==0 ){
5898 sqlite3_prepare_v2(pCur->db, zSql, -1, &pCur->pStmt, 0);
5906 if( pCur->pStmt==0 ){
5924 sqlite3_prepare_v2(pCur->db, zSql, -1, &pCur->pStmt, 0);
5936 if( sqlite3_step(pCur->pStmt)==SQLITE_ROW ){
5938 pCur->zCurrentRow = (const char*)sqlite3_column_text(pCur->pStmt, iCol);
5939 pCur->szRow = sqlite3_column_bytes(pCur->pStmt, iCol);
5942 sqlite3_finalize(pCur->pStmt);
5943 pCur->pStmt = 0;
10030 ** Finalize SQL statement pStmt. If (*pRc) is SQLITE_OK when this function
10034 static void idxFinalize(int *pRc, sqlite3_stmt *pStmt){
10035 int rc = sqlite3_finalize(pStmt);
10547 IdxStatement *pStmt;
10554 for(pStmt=p->pStatement; rc==SQLITE_OK && pStmt; pStmt=pStmt->pNext){
10559 "EXPLAIN QUERY PLAN %s", pStmt->zSql
10597 pStmt->zEQP = idxAppendText(&rc, pStmt->zEQP, "%s\n", zDetail);
10602 pStmt->zIdx = idxAppendText(&rc, pStmt->zIdx, "%s;\n", pEntry->zKey);
11279 sqlite3_stmt *pStmt = 0;
11280 rc = sqlite3_prepare_v2(p->dbv, zStmt, -1, &pStmt, &zStmt);
11282 if( pStmt ){
11284 const char *z = sqlite3_sql(pStmt);
11294 sqlite3_finalize(pStmt);
11367 IdxStatement *pStmt;
11370 for(pStmt=p->pStatement; pStmt && pStmt->iId!=iStmt; pStmt=pStmt->pNext);
11373 if( pStmt ) zRet = pStmt->zSql;
11376 if( pStmt ) zRet = pStmt->zIdx;
11379 if( pStmt ) zRet = pStmt->zEQP;
11511 sqlite3_stmt *pStmt; /* For fetching database pages */
11538 sqlite3_stmt *pStmt; /* For fetching database pages */
11603 sqlite3_finalize(pTab->pStmt);
11693 if( pTab->pStmt==0 ){
11694 pTab->pStmt = pCsr->pStmt;
11696 sqlite3_finalize(pCsr->pStmt);
11698 pCsr->pStmt = 0;
11750 sqlite3_stmt *pStmt = pCsr->pStmt;
11755 sqlite3_bind_int64(pStmt, 2, pgno);
11756 if( SQLITE_ROW==sqlite3_step(pStmt) ){
11757 int nCopy = sqlite3_column_bytes(pStmt, 0);
11764 const u8 *pCopy = sqlite3_column_blob(pStmt, 0);
11772 rc2 = sqlite3_reset(pStmt);
12136 sqlite3_stmt *pStmt = 0;
12145 rc = sqlite3_prepare_v2(pTab->db, zSql, -1, &pStmt, 0);
12147 if( rc==SQLITE_OK && sqlite3_step(pStmt)==SQLITE_ROW ){
12148 pCsr->szDb = sqlite3_column_int(pStmt, 0);
12150 rc2 = sqlite3_finalize(pStmt);
12202 if( pTab->pStmt ){
12203 pCsr->pStmt = pTab->pStmt;
12204 pTab->pStmt = 0;
12210 rc = sqlite3_prepare_v2(pTab->db, zSql, -1, &pCsr->pStmt, 0);
12216 &pCsr->pStmt, 0
12221 rc = sqlite3_bind_text(pCsr->pStmt, 1, zSchema, -1, SQLITE_TRANSIENT);
13061 sqlite3_stmt *pStmt = 0;
13063 if( sqlite3_prepare_v2(db, zSql, -1, &pStmt, 0) ){
13067 return pStmt;
13086 sqlite3_stmt *pStmt = 0;
13096 pStmt = recoverPrepare(p, db, z);
13100 return pStmt;
13104 ** Reset SQLite statement handle pStmt. If the call to sqlite3_reset()
13112 static sqlite3_stmt *recoverReset(sqlite3_recover *p, sqlite3_stmt *pStmt){
13113 int rc = sqlite3_reset(pStmt);
13115 recoverDbError(p, sqlite3_db_handle(pStmt));
13117 return pStmt;
13121 ** Finalize SQLite statement handle pStmt. If the call to sqlite3_reset()
13126 static void recoverFinalize(sqlite3_recover *p, sqlite3_stmt *pStmt){
13127 sqlite3 *db = sqlite3_db_handle(pStmt);
13128 int rc = sqlite3_finalize(pStmt);
13154 ** Bind the value pVal to parameter iBind of statement pStmt. Leave an
13160 sqlite3_stmt *pStmt,
13165 int rc = sqlite3_bind_value(pStmt, iBind, pVal);
13211 sqlite3_stmt *pStmt = 0;
13212 pStmt = recoverPreparePrintf(p, p->dbIn, "PRAGMA %Q.page_count", p->zDb);
13213 if( pStmt ){
13214 sqlite3_step(pStmt);
13215 nPg = sqlite3_column_int64(pStmt, 0);
13217 recoverFinalize(p, pStmt);
13298 sqlite3_stmt *pStmt = 0;
13307 pStmt = p->pGetPage = recoverPreparePrintf(
13311 pStmt = p->pGetPage;
13314 if( pStmt ){
13315 sqlite3_bind_int64(pStmt, 1, pgno);
13316 if( SQLITE_ROW==sqlite3_step(pStmt) ){
13320 aPg = sqlite3_column_blob(pStmt, 0);
13321 nPg = sqlite3_column_bytes(pStmt, 0);
13327 recoverReset(p, pStmt);
13651 sqlite3_stmt *pStmt = recoverPreparePrintf(p, p->dbOut,
13655 if( pStmt ){
13662 while( sqlite3_step(pStmt)==SQLITE_ROW ){
13664 nByte += (sqlite3_column_bytes(pStmt, 1)+1);
13667 recoverReset(p, pStmt);
13681 for(i=0; sqlite3_step(pStmt)==SQLITE_ROW; i++){
13682 int iPKF = sqlite3_column_int(pStmt, 5);
13683 int n = sqlite3_column_bytes(pStmt, 1);
13684 const char *z = (const char*)sqlite3_column_text(pStmt, 1);
13685 const char *zType = (const char*)sqlite3_column_text(pStmt, 2);
13686 int eHidden = sqlite3_column_int(pStmt, 6);
13711 recoverFinalize(p, pStmt);
13713 pStmt = recoverPreparePrintf(p, p->dbOut, "PRAGMA index_xinfo(%Q)", zName);
13714 while( pStmt && sqlite3_step(pStmt)==SQLITE_ROW ){
13715 int iField = sqlite3_column_int(pStmt, 0);
13716 int iCol = sqlite3_column_int(pStmt, 1);
13724 recoverFinalize(p, pStmt);
14456 sqlite3_stmt *pStmt = 0;
14466 pStmt = recoverPrepare(
14496 if( pStmt ) sqlite3_bind_int(pStmt, 1, p->bFreelistCorrupt);
14497 pLaf->pUsedPages = pStmt;
15579 sqlite3_stmt *pStmt; /* Current statement if any. */
16616 if( i==1 && p->aiIndent && p->pStmt ){
16803 double r = sqlite3_column_double(p->pStmt, i);
16819 }else if( aiType && aiType[i]==SQLITE_BLOB && p->pStmt ){
16820 const void *pBlob = sqlite3_column_blob(p->pStmt, i);
16821 int nBlob = sqlite3_column_bytes(p->pStmt, i);
16849 double r = sqlite3_column_double(p->pStmt, i);
16860 }else if( aiType && aiType[i]==SQLITE_BLOB && p->pStmt ){
16861 const void *pBlob = sqlite3_column_blob(p->pStmt, i);
16862 int nBlob = sqlite3_column_bytes(p->pStmt, i);
16896 double r = sqlite3_column_double(p->pStmt, i);
16899 }else if( aiType && aiType[i]==SQLITE_BLOB && p->pStmt ){
16900 const void *pBlob = sqlite3_column_blob(p->pStmt, i);
16901 int nBlob = sqlite3_column_bytes(p->pStmt, i);
17240 if( pArg->pStmt && pArg->statsOn==2 ){
17242 sqlite3_stmt *pStmt = pArg->pStmt;
17244 nCol = sqlite3_column_count(pStmt);
17248 utf8_printf(out, "%-36s %s\n", z, sqlite3_column_name(pStmt,i));
17251 utf8_printf(out, "%-36s %s\n", z, sqlite3_column_decltype(pStmt, i));
17255 utf8_printf(out, "%-36s %s\n", z, sqlite3_column_database_name(pStmt,i));
17257 utf8_printf(out, "%-36s %s\n", z, sqlite3_column_table_name(pStmt,i));
17259 utf8_printf(out, "%-36s %s\n", z, sqlite3_column_origin_name(pStmt,i));
17265 if( pArg->pStmt ){
17266 iCur = sqlite3_stmt_status(pArg->pStmt, SQLITE_STMTSTATUS_VM_STEP, bReset);
17338 if( pArg->pStmt ){
17340 iCur = sqlite3_stmt_status(pArg->pStmt, SQLITE_STMTSTATUS_FULLSCAN_STEP,
17343 iCur = sqlite3_stmt_status(pArg->pStmt, SQLITE_STMTSTATUS_SORT, bReset);
17345 iCur = sqlite3_stmt_status(pArg->pStmt, SQLITE_STMTSTATUS_AUTOINDEX,bReset);
17347 iHit = sqlite3_stmt_status(pArg->pStmt, SQLITE_STMTSTATUS_FILTER_HIT, bReset);
17348 iMiss = sqlite3_stmt_status(pArg->pStmt, SQLITE_STMTSTATUS_FILTER_MISS, bReset);
17353 iCur = sqlite3_stmt_status(pArg->pStmt, SQLITE_STMTSTATUS_VM_STEP, bReset);
17355 iCur = sqlite3_stmt_status(pArg->pStmt, SQLITE_STMTSTATUS_REPREPARE,bReset);
17357 iCur = sqlite3_stmt_status(pArg->pStmt, SQLITE_STMTSTATUS_RUN, bReset);
17359 iCur = sqlite3_stmt_status(pArg->pStmt, SQLITE_STMTSTATUS_MEMUSED, bReset);
17389 sqlite3_stmt *p = pArg->pStmt;
17593 static void bind_prepared_stmt(ShellState *pArg, sqlite3_stmt *pStmt){
17599 nVar = sqlite3_bind_parameter_count(pStmt);
17611 const char *zVar = sqlite3_bind_parameter_name(pStmt, i);
17618 sqlite3_bind_value(pStmt, i, sqlite3_column_value(pQ, 0));
17620 sqlite3_bind_null(pStmt, i);
17788 /* Extract the value of the i-th current column for pStmt as an SQL literal
17792 static char *quoted_column(sqlite3_stmt *pStmt, int i){
17793 switch( sqlite3_column_type(pStmt, i) ){
17799 return sqlite3_mprintf("%s",sqlite3_column_text(pStmt,i));
17802 return sqlite3_mprintf("%Q",sqlite3_column_text(pStmt,i));
17807 const unsigned char *a = sqlite3_column_blob(pStmt,i);
17808 int n = sqlite3_column_bytes(pStmt,i);
17832 sqlite3_stmt *pStmt /* Statment to run */
17854 rc = sqlite3_step(pStmt);
17856 nColumn = sqlite3_column_count(pStmt);
17891 uz = (const unsigned char*)sqlite3_column_name(pStmt,i);
17917 azQuoted[i] = quoted_column(pStmt,i);
17920 uz = (const unsigned char*)sqlite3_column_text(pStmt,i);
17931 }while( bNextLine || sqlite3_step(pStmt)==SQLITE_ROW );
18057 sqlite3_stmt *pStmt /* Statment to run */
18067 exec_prepared_stmt_columnar(pArg, pStmt);
18074 rc = sqlite3_step(pStmt);
18078 int nCol = sqlite3_column_count(pStmt);
18090 azCols[i] = (char *)sqlite3_column_name(pStmt, i);
18096 aiTypes[i] = x = sqlite3_column_type(pStmt, i);
18103 azVals[i] = (char*)sqlite3_column_text(pStmt, i);
18117 rc = sqlite3_step(pStmt);
18280 sqlite3_stmt *pStmt = NULL; /* Statement to execute. */
18299 rc = sqlite3_prepare_v2(db, zSql, -1, &pStmt, &zLeftover);
18305 if( !pStmt ){
18311 zStmtSql = sqlite3_sql(pStmt);
18317 pArg->pStmt = pStmt;
18322 if( pArg && pArg->autoEQP && sqlite3_stmt_isexplain(pStmt)==0 ){
18363 /* Reprepare pStmt before reactiving trace modes */
18364 sqlite3_finalize(pStmt);
18365 sqlite3_prepare_v2(db, zSql, -1, &pStmt, 0);
18366 if( pArg ) pArg->pStmt = pStmt;
18374 if( sqlite3_stmt_isexplain(pStmt)==1 ){
18377 if( sqlite3_stmt_isexplain(pStmt)==2 ){
18385 explain_data_prepare(pArg, pStmt);
18389 bind_prepared_stmt(pArg, pStmt);
18390 exec_prepared_stmt(pArg, pStmt);
18407 rc2 = sqlite3_finalize(pStmt);
18418 pArg->pStmt = NULL;
18453 sqlite3_stmt *pStmt;
18464 rc = sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0);
18467 while( sqlite3_step(pStmt)==SQLITE_ROW ){
18473 azCol[++nCol] = sqlite3_mprintf("%s", sqlite3_column_text(pStmt, 1));
18475 if( sqlite3_column_int(pStmt, 5) ){
18478 && sqlite3_stricmp((const char*)sqlite3_column_text(pStmt,2),
18487 sqlite3_finalize(pStmt);
18509 rc = sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0);
18515 rc = sqlite3_step(pStmt);
18516 sqlite3_finalize(pStmt);
18546 sqlite3_stmt *pStmt = 0;
18549 sqlite3_prepare_v2(db, "PRAGMA reverse_unordered_selects", -1, &pStmt, 0);
18550 if( sqlite3_step(pStmt)==SQLITE_ROW ){
18551 iSetting = sqlite3_column_int(pStmt, 0);
18553 sqlite3_finalize(pStmt);
19618 static sqlite3_stmt *pStmt = 0;
19622 sqlite3_finalize(pStmt);
19626 sqlite3_prepare_v2(globalDb, zSql, -1, &pStmt, 0);
19629 if( sqlite3_step(pStmt)==SQLITE_ROW ){
19630 const char *z = (const char*)sqlite3_column_text(pStmt,0);
19633 sqlite3_finalize(pStmt);
19634 pStmt = 0;
19651 sqlite3_stmt *pStmt = 0;
19665 sqlite3_prepare_v2(globalDb, zSql, -1, &pStmt, 0);
19668 while( sqlite3_step(pStmt)==SQLITE_ROW ){
19669 const char *zCompletion = (const char*)sqlite3_column_text(pStmt, 0);
19670 int nCompletion = sqlite3_column_bytes(pStmt, 0);
19676 sqlite3_finalize(pStmt);
19814 sqlite3_stmt *pStmt;
19825 pStmt = (sqlite3_stmt*)pP;
19828 zSql = sqlite3_expanded_sql(pStmt);
19833 zSql = sqlite3_normalized_sql(pStmt);
19838 zSql = sqlite3_sql(pStmt);
20303 sqlite3_stmt *pStmt;
20305 sqlite3_prepare_v2(db, zSql, -1, &pStmt, 0);
20306 if( pStmt && sqlite3_step(pStmt)==SQLITE_ROW ){
20307 res = sqlite3_column_int(pStmt,0);
20309 sqlite3_finalize(pStmt);
20360 sqlite3_stmt *pStmt = 0;
20366 -1, &pStmt, 0);
20369 sqlite3_finalize(pStmt);
20372 sqlite3_bind_text(pStmt, 1, zDb, -1, SQLITE_STATIC);
20373 if( sqlite3_step(pStmt)==SQLITE_ROW
20374 && sqlite3_column_bytes(pStmt,0)>100
20376 memcpy(aHdr, sqlite3_column_blob(pStmt,0), 100);
20377 sqlite3_finalize(pStmt);
20380 sqlite3_finalize(pStmt);
20906 sqlite3_stmt *pStmt
20908 if( pStmt ){
20909 sqlite3 *db = sqlite3_db_handle(pStmt);
20910 int rc = sqlite3_finalize(pStmt);
20928 sqlite3_stmt *pStmt
20930 int rc = sqlite3_reset(pStmt);
20933 sqlite3 *db = sqlite3_db_handle(pStmt);
21917 sqlite3_stmt *pStmt = 0;
21932 rc = sqlite3_prepare_v2(*pDb, zTabFill, -1, &pStmt, 0);
21934 rc = sqlite3_bind_text(pStmt, 1, zColNew, -1, 0);
21936 rc = sqlite3_step(pStmt);
21938 sqlite3_finalize(pStmt);
21954 rc = sqlite3_prepare_v2(*pDb, zRenameRank, -1, &pStmt, 0);
21956 sqlite3_bind_int(pStmt, 1, nDigits);
21957 rc = sqlite3_step(pStmt);
21958 sqlite3_finalize(pStmt);
21962 rc = sqlite3_prepare_v2(*pDb, zCollectVar, -1, &pStmt, 0);
21964 rc = sqlite3_step(pStmt);
21966 zColsSpec = sqlite3_mprintf("%s", sqlite3_column_text(pStmt, 0));
21973 sqlite3_finalize(pStmt);
21974 if( SQLITE_OK==sqlite3_prepare_v2(*pDb, zRenamesDone, -1, &pStmt, 0)
21975 && SQLITE_ROW==sqlite3_step(pStmt) ){
21976 *pzRenamed = sqlite3_mprintf("%s", sqlite3_column_text(pStmt, 0));
21981 sqlite3_finalize(pStmt);
22285 sqlite3_stmt *pStmt;
22288 rc = sqlite3_prepare_v2(p->db, "PRAGMA database_list", -1, &pStmt, 0);
22293 while( sqlite3_step(pStmt)==SQLITE_ROW ){
22294 const char *zSchema = (const char *)sqlite3_column_text(pStmt,1);
22295 const char *zFile = (const char*)sqlite3_column_text(pStmt,2);
22304 sqlite3_finalize(pStmt);
22741 sqlite3_stmt *pStmt;
22745 -1, &pStmt, 0);
22746 doStats = sqlite3_step(pStmt)==SQLITE_ROW;
22747 sqlite3_finalize(pStmt);
22788 sqlite3_stmt *pStmt = NULL; /* A statement */
22943 rc = sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0);
22983 rc = sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0);
22986 if (pStmt) sqlite3_finalize(pStmt);
22991 nCol = sqlite3_column_count(pStmt);
22992 sqlite3_finalize(pStmt);
22993 pStmt = 0;
23011 rc = sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0);
23014 if (pStmt) sqlite3_finalize(pStmt);
23036 sqlite3_bind_text(pStmt, i+1, z, -1, SQLITE_TRANSIENT);
23042 while( i<=nCol ){ sqlite3_bind_null(pStmt, i); i++; }
23055 sqlite3_step(pStmt);
23056 rc = sqlite3_reset(pStmt);
23068 sqlite3_finalize(pStmt);
23082 sqlite3_stmt *pStmt;
23114 sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0);
23116 if( sqlite3_step(pStmt)==SQLITE_ROW ){
23117 tnum = sqlite3_column_int(pStmt, 0);
23118 isWO = sqlite3_column_int(pStmt, 1);
23120 sqlite3_finalize(pStmt);
23122 rc = sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0);
23125 while( rc==SQLITE_OK && sqlite3_step(pStmt)==SQLITE_ROW ){
23127 const char *zCol = (const char*)sqlite3_column_text(pStmt,2);
23130 if( sqlite3_column_int(pStmt,1)==-1 ){
23137 if( isWO && lenPK==0 && sqlite3_column_int(pStmt,5)==0 && zCollist ){
23146 sqlite3_finalize(pStmt);
23680 sqlite3_stmt *pStmt = 0;
23685 "FROM temp.sqlite_parameters;", -1, &pStmt, 0);
23686 if( rx==SQLITE_OK && sqlite3_step(pStmt)==SQLITE_ROW ){
23687 len = sqlite3_column_int(pStmt, 0);
23690 sqlite3_finalize(pStmt);
23691 pStmt = 0;
23695 "FROM temp.sqlite_parameters;", -1, &pStmt, 0);
23696 while( rx==SQLITE_OK && sqlite3_step(pStmt)==SQLITE_ROW ){
23697 utf8_printf(p->out, "%-*s %s\n", len, sqlite3_column_text(pStmt,0),
23698 sqlite3_column_text(pStmt,1));
23700 sqlite3_finalize(pStmt);
23721 sqlite3_stmt *pStmt;
23729 pStmt = 0;
23730 rx = sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0);
23733 sqlite3_finalize(pStmt);
23734 pStmt = 0;
23739 rx = sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0);
23743 sqlite3_finalize(pStmt);
23744 pStmt = 0;
23748 sqlite3_step(pStmt);
23749 sqlite3_finalize(pStmt);
24000 sqlite3_stmt *pStmt = 0;
24002 -1, &pStmt, 0);
24005 sqlite3_finalize(pStmt);
24011 while( sqlite3_step(pStmt)==SQLITE_ROW ){
24012 const char *zDb = (const char*)sqlite3_column_text(pStmt, 0);
24031 sqlite3_finalize(pStmt);
24325 sqlite3_stmt *pStmt = 0; /* Query against the SELFTEST table */
24361 -1, &pStmt, 0);
24366 -1, &pStmt, 0);
24371 sqlite3_finalize(pStmt);
24374 for(i=1; sqlite3_step(pStmt)==SQLITE_ROW; i++){
24375 int tno = sqlite3_column_int(pStmt, 0);
24376 const char *zOp = (const char*)sqlite3_column_text(pStmt, 1);
24377 const char *zSql = (const char*)sqlite3_column_text(pStmt, 2);
24378 const char *zAns = (const char*)sqlite3_column_text(pStmt, 3);
24418 sqlite3_finalize(pStmt);
24446 sqlite3_stmt *pStmt; /* For querying tables names */
24496 sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0);
24501 while( SQLITE_ROW==sqlite3_step(pStmt) ){
24502 const char *zTab = (const char*)sqlite3_column_text(pStmt,0);
24530 sqlite3_finalize(pStmt);
24653 sqlite3_stmt *pStmt;
24660 rc = sqlite3_prepare_v2(p->db, "PRAGMA database_list", -1, &pStmt, 0);
24662 sqlite3_finalize(pStmt);
24672 sqlite3_finalize(pStmt);
24675 for(ii=0; sqlite3_step(pStmt)==SQLITE_ROW; ii++){
24676 const char *zDbName = (const char*)sqlite3_column_text(pStmt, 1);
24697 rc = sqlite3_finalize(pStmt);
24700 rc = sqlite3_prepare_v2(p->db, s.z, -1, &pStmt, 0);
24710 sqlite3_bind_text(pStmt, 1, azArg[1], -1, SQLITE_TRANSIENT);
24712 sqlite3_bind_text(pStmt, 1, "%", -1, SQLITE_STATIC);
24714 while( sqlite3_step(pStmt)==SQLITE_ROW ){
24723 azResult[nRow] = sqlite3_mprintf("%s", sqlite3_column_text(pStmt, 0));
24727 if( sqlite3_finalize(pStmt)!=SQLITE_OK ){