Lines Matching defs:pStmt

1997   sqlite3_stmt *pStmt = 0;
2007 sqlite3_prepare_v2(db, zSql, -1, &pStmt, 0);
2018 while( sqlite3_step(pStmt)==SQLITE_ROW ){
2019 const char *zCol = (const char*)sqlite3_column_text(pStmt, 1);
2028 sqlite3_finalize(pStmt);
3422 sqlite3_stmt *pStmt = 0;
3444 rc = sqlite3_prepare_v2(db, zSql, -1, &pStmt, &zSql);
3448 sqlite3_finalize(pStmt);
3453 if( !sqlite3_stmt_readonly(pStmt) ){
3454 char *zMsg = sqlite3_mprintf("non-query: [%s]", sqlite3_sql(pStmt));
3455 sqlite3_finalize(pStmt);
3460 nCol = sqlite3_column_count(pStmt);
3461 z = sqlite3_sql(pStmt);
3469 while( SQLITE_ROW==sqlite3_step(pStmt) ){
3472 switch( sqlite3_column_type(pStmt,i) ){
3481 sqlite3_int64 v = sqlite3_column_int64(pStmt,i);
3495 double r = sqlite3_column_double(pStmt,i);
3506 int n2 = sqlite3_column_bytes(pStmt, i);
3507 const unsigned char *z2 = sqlite3_column_text(pStmt, i);
3513 int n2 = sqlite3_column_bytes(pStmt, i);
3514 const unsigned char *z2 = sqlite3_column_blob(pStmt, i);
3522 sqlite3_finalize(pStmt);
8260 sqlite3_stmt *pStmt; /* Current statement */
8360 sqlite3_finalize(pCur->pStmt); pCur->pStmt = 0;
8376 ** The ->ePhase, ->j, and ->pStmt fields of the completion_cursor object
8390 int iCol = -1; /* If >=0, step pCur->pStmt and use the i-th column */
8405 if( pCur->pStmt==0 ){
8407 &pCur->pStmt, 0);
8414 if( pCur->pStmt==0 ){
8430 sqlite3_prepare_v2(pCur->db, zSql, -1, &pCur->pStmt, 0);
8438 if( pCur->pStmt==0 ){
8456 sqlite3_prepare_v2(pCur->db, zSql, -1, &pCur->pStmt, 0);
8468 if( sqlite3_step(pCur->pStmt)==SQLITE_ROW ){
8470 pCur->zCurrentRow = (const char*)sqlite3_column_text(pCur->pStmt, iCol);
8471 pCur->szRow = sqlite3_column_bytes(pCur->pStmt, iCol);
8474 sqlite3_finalize(pCur->pStmt);
8475 pCur->pStmt = 0;
12590 ** Finalize SQL statement pStmt. If (*pRc) is SQLITE_OK when this function
12594 static void idxFinalize(int *pRc, sqlite3_stmt *pStmt){
12595 int rc = sqlite3_finalize(pStmt);
13107 IdxStatement *pStmt;
13114 for(pStmt=p->pStatement; rc==SQLITE_OK && pStmt; pStmt=pStmt->pNext){
13119 "EXPLAIN QUERY PLAN %s", pStmt->zSql
13157 pStmt->zEQP = idxAppendText(&rc, pStmt->zEQP, "%s\n", zDetail);
13162 pStmt->zIdx = idxAppendText(&rc, pStmt->zIdx, "%s;\n", pEntry->zKey);
13781 sqlite3_stmt *pStmt;
13785 "WHERE builtin==0", -1, &pStmt, 0);
13787 while( SQLITE_ROW==(rc = sqlite3_step(pStmt)) ){
13788 int nargs = sqlite3_column_int(pStmt,3);
13789 int flags = sqlite3_column_int(pStmt,4);
13790 const char *name = (char*)sqlite3_column_text(pStmt,0);
13791 const char *type = (char*)sqlite3_column_text(pStmt,1);
13792 const char *enc = (char*)sqlite3_column_text(pStmt,2);
13817 sqlite3_finalize(pStmt);
13939 sqlite3_stmt *pStmt = 0;
13941 rc = idxPrepareStmt(p->db, &pStmt, pzErr, zStmt);
13943 sqlite3_finalize(pStmt);
13944 rc = sqlite3_prepare_v2(p->dbv, zStmt, -1, &pStmt, &zStmt);
13946 if( pStmt ){
13948 const char *z = sqlite3_sql(pStmt);
13958 sqlite3_finalize(pStmt);
14031 IdxStatement *pStmt;
14034 for(pStmt=p->pStatement; pStmt && pStmt->iId!=iStmt; pStmt=pStmt->pNext);
14037 if( pStmt ) zRet = pStmt->zSql;
14040 if( pStmt ) zRet = pStmt->zIdx;
14043 if( pStmt ) zRet = pStmt->zEQP;
14361 ** Finalize SQL statement pStmt. If an error occurs and the handle passed
14365 static void intckFinalize(sqlite3_intck *p, sqlite3_stmt *pStmt){
14366 int rc = sqlite3_finalize(pStmt);
14376 static int intckStep(sqlite3_intck *p, sqlite3_stmt *pStmt){
14378 return sqlite3_step(pStmt);
14387 sqlite3_stmt *pStmt = 0;
14388 pStmt = intckPrepare(p, zSql);
14389 intckStep(p, pStmt);
14390 intckFinalize(p, pStmt);
14421 sqlite3_stmt *pStmt = 0;
14498 pStmt = intckPrepare(p, zSql);
14501 sqlite3_bind_value(pStmt, ii+1, sqlite3_column_value(p->pCheck, ii+1));
14503 if( SQLITE_ROW==sqlite3_step(pStmt) ){
14504 p->zKey = intckMprintf(p,"%s",(const char*)sqlite3_column_text(pStmt, 0));
14506 intckFinalize(p, pStmt);
14519 sqlite3_stmt *pStmt = 0;
14526 pStmt = intckPrepareFmt(p,
14540 sqlite3_bind_text(pStmt, 1, zPrev, -1, SQLITE_TRANSIENT);
14541 if( sqlite3_step(pStmt)==SQLITE_ROW ){
14542 p->zObj = intckMprintf(p,"%s",(const char*)sqlite3_column_text(pStmt, 0));
14545 intckFinalize(p, pStmt);
14718 sqlite3_stmt *pStmt = 0;
14719 pStmt = intckPrepare(p, "PRAGMA automatic_index");
14720 if( SQLITE_ROW==intckStep(p, pStmt) ){
14721 bRet = sqlite3_column_int(pStmt, 0);
14723 intckFinalize(p, pStmt);
14732 sqlite3_stmt *pStmt = 0;
14733 pStmt = intckPrepareFmt(p,
14737 if( p->rc==SQLITE_OK && SQLITE_ROW==sqlite3_step(pStmt) ){
14740 intckFinalize(p, pStmt);
14761 sqlite3_stmt *pStmt = 0;
14878 pStmt = intckPrepareFmt(p,
14932 pStmt = intckPrepareFmt(p,
15012 while( p->rc==SQLITE_OK && SQLITE_ROW==sqlite3_step(pStmt) ){
15013 zRet = intckMprintf(p, "%s", (const char*)sqlite3_column_text(pStmt, 0));
15015 *pnKeyVal = sqlite3_column_int(pStmt, 1);
15018 intckFinalize(p, pStmt);
15554 sqlite3_stmt *pStmt; /* For fetching database pages */
15581 sqlite3_stmt *pStmt; /* For fetching database pages */
15675 sqlite3_finalize(pTab->pStmt);
15765 if( pTab->pStmt==0 ){
15766 pTab->pStmt = pCsr->pStmt;
15768 sqlite3_finalize(pCsr->pStmt);
15770 pCsr->pStmt = 0;
15822 sqlite3_stmt *pStmt = pCsr->pStmt;
15827 sqlite3_bind_int64(pStmt, 2, pgno);
15828 if( SQLITE_ROW==sqlite3_step(pStmt) ){
15829 int nCopy = sqlite3_column_bytes(pStmt, 0);
15836 const u8 *pCopy = sqlite3_column_blob(pStmt, 0);
15844 rc2 = sqlite3_reset(pStmt);
16247 sqlite3_stmt *pStmt = 0;
16256 rc = sqlite3_prepare_v2(pTab->db, zSql, -1, &pStmt, 0);
16258 if( rc==SQLITE_OK && sqlite3_step(pStmt)==SQLITE_ROW ){
16259 pCsr->szDb = sqlite3_column_int(pStmt, 0);
16261 rc2 = sqlite3_finalize(pStmt);
16314 if( pTab->pStmt ){
16315 pCsr->pStmt = pTab->pStmt;
16316 pTab->pStmt = 0;
16322 rc = sqlite3_prepare_v2(pTab->db, zSql, -1, &pCsr->pStmt, 0);
16328 &pCsr->pStmt, 0
16333 rc = sqlite3_bind_text(pCsr->pStmt, 1, zSchema, -1, SQLITE_TRANSIENT);
16921 sqlite3_stmt *pStmt = 0;
16923 if( sqlite3_prepare_v2(db, zSql, -1, &pStmt, 0) ){
16927 return pStmt;
16946 sqlite3_stmt *pStmt = 0;
16956 pStmt = recoverPrepare(p, db, z);
16960 return pStmt;
16964 ** Reset SQLite statement handle pStmt. If the call to sqlite3_reset()
16972 static sqlite3_stmt *recoverReset(sqlite3_recover *p, sqlite3_stmt *pStmt){
16973 int rc = sqlite3_reset(pStmt);
16975 recoverDbError(p, sqlite3_db_handle(pStmt));
16977 return pStmt;
16981 ** Finalize SQLite statement handle pStmt. If the call to sqlite3_reset()
16986 static void recoverFinalize(sqlite3_recover *p, sqlite3_stmt *pStmt){
16987 sqlite3 *db = sqlite3_db_handle(pStmt);
16988 int rc = sqlite3_finalize(pStmt);
17014 ** Bind the value pVal to parameter iBind of statement pStmt. Leave an
17020 sqlite3_stmt *pStmt,
17025 int rc = sqlite3_bind_value(pStmt, iBind, pVal);
17071 sqlite3_stmt *pStmt = 0;
17072 pStmt = recoverPreparePrintf(p, p->dbIn, "PRAGMA %Q.page_count", p->zDb);
17073 if( pStmt ){
17074 sqlite3_step(pStmt);
17075 nPg = sqlite3_column_int64(pStmt, 0);
17077 recoverFinalize(p, pStmt);
17158 sqlite3_stmt *pStmt = 0;
17167 pStmt = p->pGetPage = recoverPreparePrintf(
17171 pStmt = p->pGetPage;
17174 if( pStmt ){
17175 sqlite3_bind_int64(pStmt, 1, pgno);
17176 if( SQLITE_ROW==sqlite3_step(pStmt) ){
17180 aPg = sqlite3_column_blob(pStmt, 0);
17181 nPg = sqlite3_column_bytes(pStmt, 0);
17187 recoverReset(p, pStmt);
17514 sqlite3_stmt *pStmt = recoverPreparePrintf(p, p->dbOut,
17518 if( pStmt ){
17525 while( sqlite3_step(pStmt)==SQLITE_ROW ){
17527 nByte += (sqlite3_column_bytes(pStmt, 1)+1);
17530 recoverReset(p, pStmt);
17544 for(i=0; sqlite3_step(pStmt)==SQLITE_ROW; i++){
17545 int iPKF = sqlite3_column_int(pStmt, 5);
17546 int n = sqlite3_column_bytes(pStmt, 1);
17547 const char *z = (const char*)sqlite3_column_text(pStmt, 1);
17548 const char *zType = (const char*)sqlite3_column_text(pStmt, 2);
17549 int eHidden = sqlite3_column_int(pStmt, 6);
17574 recoverFinalize(p, pStmt);
17576 pStmt = recoverPreparePrintf(p, p->dbOut, "PRAGMA index_xinfo(%Q)", zName);
17577 while( pStmt && sqlite3_step(pStmt)==SQLITE_ROW ){
17578 int iField = sqlite3_column_int(pStmt, 0);
17579 int iCol = sqlite3_column_int(pStmt, 1);
17587 recoverFinalize(p, pStmt);
18319 sqlite3_stmt *pStmt = 0;
18329 pStmt = recoverPrepare(
18359 if( pStmt ) sqlite3_bind_int(pStmt, 1, p->bFreelistCorrupt);
18360 pLaf->pUsedPages = pStmt;
19453 sqlite3_stmt *pStmt; /* Current statement if any. */
20570 if( i==iIndent && p->aiIndent && p->pStmt ){
20752 double r = sqlite3_column_double(p->pStmt, i);
20768 }else if( aiType && aiType[i]==SQLITE_BLOB && p->pStmt ){
20769 const void *pBlob = sqlite3_column_blob(p->pStmt, i);
20770 int nBlob = sqlite3_column_bytes(p->pStmt, i);
20798 double r = sqlite3_column_double(p->pStmt, i);
20809 }else if( aiType && aiType[i]==SQLITE_BLOB && p->pStmt ){
20810 const void *pBlob = sqlite3_column_blob(p->pStmt, i);
20811 int nBlob = sqlite3_column_bytes(p->pStmt, i);
20845 double r = sqlite3_column_double(p->pStmt, i);
20848 }else if( aiType && aiType[i]==SQLITE_BLOB && p->pStmt ){
20849 const void *pBlob = sqlite3_column_blob(p->pStmt, i);
20850 int nBlob = sqlite3_column_bytes(p->pStmt, i);
21186 if( pArg->pStmt && pArg->statsOn==2 ){
21188 sqlite3_stmt *pStmt = pArg->pStmt;
21190 nCol = sqlite3_column_count(pStmt);
21194 oputf("%-36s %s\n", z, sqlite3_column_name(pStmt,i));
21197 oputf("%-36s %s\n", z, sqlite3_column_decltype(pStmt, i));
21201 oputf("%-36s %s\n", z, sqlite3_column_database_name(pStmt,i));
21203 oputf("%-36s %s\n", z, sqlite3_column_table_name(pStmt,i));
21205 oputf("%-36s %s\n", z, sqlite3_column_origin_name(pStmt,i));
21211 if( pArg->pStmt ){
21212 iCur = sqlite3_stmt_status(pArg->pStmt, SQLITE_STMTSTATUS_VM_STEP,bReset);
21276 if( pArg->pStmt ){
21278 iCur = sqlite3_stmt_status(pArg->pStmt, SQLITE_STMTSTATUS_FULLSCAN_STEP,
21281 iCur = sqlite3_stmt_status(pArg->pStmt, SQLITE_STMTSTATUS_SORT, bReset);
21283 iCur = sqlite3_stmt_status(pArg->pStmt, SQLITE_STMTSTATUS_AUTOINDEX,bReset);
21285 iHit = sqlite3_stmt_status(pArg->pStmt, SQLITE_STMTSTATUS_FILTER_HIT,
21287 iMiss = sqlite3_stmt_status(pArg->pStmt, SQLITE_STMTSTATUS_FILTER_MISS,
21292 iCur = sqlite3_stmt_status(pArg->pStmt, SQLITE_STMTSTATUS_VM_STEP, bReset);
21294 iCur = sqlite3_stmt_status(pArg->pStmt, SQLITE_STMTSTATUS_REPREPARE,bReset);
21296 iCur = sqlite3_stmt_status(pArg->pStmt, SQLITE_STMTSTATUS_RUN, bReset);
21298 iCur = sqlite3_stmt_status(pArg->pStmt, SQLITE_STMTSTATUS_MEMUSED, bReset);
21346 sqlite3_stmt *p = pArg->pStmt;
21544 sqlite3_stmt *pStmt = 0;
21545 rc = sqlite3_prepare_v2(db, zSql, -1, &pStmt, 0);
21547 sqlite3_stmt *pSave = pArg->pStmt;
21548 pArg->pStmt = pStmt;
21549 sqlite3_bind_pointer(pStmt, 1, pSave, "stmt-pointer", 0);
21553 explain_data_prepare(pArg, pStmt);
21554 exec_prepared_stmt(pArg, pStmt);
21557 sqlite3_finalize(pStmt);
21558 pArg->pStmt = pSave;
21613 static void bind_prepared_stmt(ShellState *pArg, sqlite3_stmt *pStmt){
21619 nVar = sqlite3_bind_parameter_count(pStmt);
21632 const char *zVar = sqlite3_bind_parameter_name(pStmt, i);
21639 sqlite3_bind_value(pStmt, i, sqlite3_column_value(pQ, 0));
21642 sqlite3_bind_double(pStmt, i, NAN);
21646 sqlite3_bind_double(pStmt, i, INFINITY);
21649 sqlite3_bind_null(pStmt, i);
21817 /* Extract the value of the i-th current column for pStmt as an SQL literal
21821 static char *quoted_column(sqlite3_stmt *pStmt, int i){
21822 switch( sqlite3_column_type(pStmt, i) ){
21828 return sqlite3_mprintf("%s",sqlite3_column_text(pStmt,i));
21831 return sqlite3_mprintf("%Q",sqlite3_column_text(pStmt,i));
21836 const unsigned char *a = sqlite3_column_blob(pStmt,i);
21837 int n = sqlite3_column_bytes(pStmt,i);
21861 sqlite3_stmt *pStmt /* Statement to run */
21883 rc = sqlite3_step(pStmt);
21885 nColumn = sqlite3_column_count(pStmt);
21921 uz = (const unsigned char*)sqlite3_column_name(pStmt,i);
21948 azQuoted[i] = quoted_column(pStmt,i);
21951 uz = (const unsigned char*)sqlite3_column_text(pStmt,i);
21962 }while( bNextLine || sqlite3_step(pStmt)==SQLITE_ROW );
22087 sqlite3_stmt *pStmt /* Statement to run */
22097 exec_prepared_stmt_columnar(pArg, pStmt);
22104 rc = sqlite3_step(pStmt);
22108 int nCol = sqlite3_column_count(pStmt);
22120 azCols[i] = (char *)sqlite3_column_name(pStmt, i);
22126 aiTypes[i] = x = sqlite3_column_type(pStmt, i);
22133 azVals[i] = (char*)sqlite3_column_text(pStmt, i);
22147 rc = sqlite3_step(pStmt);
22309 sqlite3_stmt *pStmt = NULL; /* Statement to execute. */
22328 rc = sqlite3_prepare_v2(db, zSql, -1, &pStmt, &zLeftover);
22334 if( !pStmt ){
22340 zStmtSql = sqlite3_sql(pStmt);
22346 pArg->pStmt = pStmt;
22351 if( pArg && pArg->autoEQP && sqlite3_stmt_isexplain(pStmt)==0 ){
22359 pExplain = pStmt;
22388 sqlite3_reset(pStmt);
22389 sqlite3_stmt_explain(pStmt, 0);
22394 int bIsExplain = (sqlite3_stmt_isexplain(pStmt)==1);
22400 if( sqlite3_stmt_isexplain(pStmt)==2 ){
22408 explain_data_prepare(pArg, pStmt);
22412 bind_prepared_stmt(pArg, pStmt);
22413 exec_prepared_stmt(pArg, pStmt);
22430 rc2 = sqlite3_finalize(pStmt);
22441 pArg->pStmt = NULL;
22476 sqlite3_stmt *pStmt;
22487 rc = sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0);
22490 while( sqlite3_step(pStmt)==SQLITE_ROW ){
22496 azCol[++nCol] = sqlite3_mprintf("%s", sqlite3_column_text(pStmt, 1));
22498 if( sqlite3_column_int(pStmt, 5) ){
22501 && sqlite3_stricmp((const char*)sqlite3_column_text(pStmt,2),
22510 sqlite3_finalize(pStmt);
22532 rc = sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0);
22538 rc = sqlite3_step(pStmt);
22539 sqlite3_finalize(pStmt);
22569 sqlite3_stmt *pStmt = 0;
22572 sqlite3_prepare_v2(db, "PRAGMA reverse_unordered_selects", -1, &pStmt, 0);
22573 if( sqlite3_step(pStmt)==SQLITE_ROW ){
22574 iSetting = sqlite3_column_int(pStmt, 0);
22576 sqlite3_finalize(pStmt);
23597 static sqlite3_stmt *pStmt = 0;
23601 sqlite3_finalize(pStmt);
23605 sqlite3_prepare_v2(globalDb, zSql, -1, &pStmt, 0);
23608 if( sqlite3_step(pStmt)==SQLITE_ROW ){
23609 const char *z = (const char*)sqlite3_column_text(pStmt,0);
23612 sqlite3_finalize(pStmt);
23613 pStmt = 0;
23632 sqlite3_stmt *pStmt = 0;
23646 sqlite3_prepare_v2(globalDb, zSql, -1, &pStmt, 0);
23649 while( sqlite3_step(pStmt)==SQLITE_ROW ){
23650 const char *zCompletion = (const char*)sqlite3_column_text(pStmt, 0);
23651 int nCompletion = sqlite3_column_bytes(pStmt, 0);
23657 sqlite3_finalize(pStmt);
23804 sqlite3_stmt *pStmt;
23815 pStmt = (sqlite3_stmt*)pP;
23818 zSql = sqlite3_expanded_sql(pStmt);
23823 zSql = sqlite3_normalized_sql(pStmt);
23828 zSql = sqlite3_sql(pStmt);
24310 sqlite3_stmt *pStmt;
24312 sqlite3_prepare_v2(db, zSql, -1, &pStmt, 0);
24313 if( pStmt && sqlite3_step(pStmt)==SQLITE_ROW ){
24314 res = sqlite3_column_int(pStmt,0);
24316 sqlite3_finalize(pStmt);
24367 sqlite3_stmt *pStmt = 0;
24373 -1, &pStmt, 0);
24376 sqlite3_finalize(pStmt);
24379 sqlite3_bind_text(pStmt, 1, zDb, -1, SQLITE_STATIC);
24380 if( sqlite3_step(pStmt)==SQLITE_ROW
24381 && sqlite3_column_bytes(pStmt,0)>100
24383 const u8 *pb = sqlite3_column_blob(pStmt,0);
24386 sqlite3_finalize(pStmt);
24389 sqlite3_finalize(pStmt);
24902 sqlite3_stmt *pStmt
24904 if( pStmt ){
24905 sqlite3 *db = sqlite3_db_handle(pStmt);
24906 int rc = sqlite3_finalize(pStmt);
24925 sqlite3_stmt *pStmt
24927 int rc = sqlite3_reset(pStmt);
24930 sqlite3 *db = sqlite3_db_handle(pStmt);
25945 sqlite3_stmt *pStmt = 0;
25961 rc = sqlite3_prepare_v2(*pDb, zTabFill, -1, &pStmt, 0);
25963 rc = sqlite3_bind_text(pStmt, 1, zColNew, -1, 0);
25965 rc = sqlite3_step(pStmt);
25967 sqlite3_finalize(pStmt);
25983 rc = sqlite3_prepare_v2(*pDb, zRenameRank, -1, &pStmt, 0);
25985 sqlite3_bind_int(pStmt, 1, nDigits);
25986 rc = sqlite3_step(pStmt);
25987 sqlite3_finalize(pStmt);
25991 rc = sqlite3_prepare_v2(*pDb, zCollectVar, -1, &pStmt, 0);
25993 rc = sqlite3_step(pStmt);
25995 zColsSpec = sqlite3_mprintf("%s", sqlite3_column_text(pStmt, 0));
26002 sqlite3_finalize(pStmt);
26003 if( SQLITE_OK==sqlite3_prepare_v2(*pDb, zRenamesDone, -1, &pStmt, 0)
26004 && SQLITE_ROW==sqlite3_step(pStmt) ){
26005 *pzRenamed = sqlite3_mprintf("%s", sqlite3_column_text(pStmt, 0));
26010 sqlite3_finalize(pStmt);
26027 sqlite3_stmt *pStmt = 0;
26028 shellPreparePrintf(p->db, &rc, &pStmt,
26032 if( rc==SQLITE_OK && sqlite3_step(pStmt)==SQLITE_ROW ){
26037 shellFinalize(&rc, pStmt);
26392 sqlite3_stmt *pStmt;
26395 rc = sqlite3_prepare_v2(p->db, "PRAGMA database_list", -1, &pStmt, 0);
26400 while( sqlite3_step(pStmt)==SQLITE_ROW ){
26401 const char *zSchema = (const char *)sqlite3_column_text(pStmt,1);
26402 const char *zFile = (const char*)sqlite3_column_text(pStmt,2);
26411 sqlite3_finalize(pStmt);
26848 sqlite3_stmt *pStmt;
26852 -1, &pStmt, 0);
26854 doStats = sqlite3_step(pStmt)==SQLITE_ROW;
26855 sqlite3_finalize(pStmt);
26897 sqlite3_stmt *pStmt = NULL; /* A statement */
27087 rc = sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0);
27091 if (pStmt) sqlite3_finalize(pStmt);
27097 if( sqlite3_step(pStmt)==SQLITE_ROW ){
27098 nCol = sqlite3_column_int(pStmt, 0);
27102 sqlite3_finalize(pStmt);
27103 pStmt = 0;
27132 rc = sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0);
27137 if (pStmt) sqlite3_finalize(pStmt);
27167 sqlite3_bind_text(pStmt, i+1, z, -1, SQLITE_TRANSIENT);
27173 while( i<=nCol ){ sqlite3_bind_null(pStmt, i); i++; }
27185 sqlite3_step(pStmt);
27186 rc = sqlite3_reset(pStmt);
27198 sqlite3_finalize(pStmt);
27211 sqlite3_stmt *pStmt;
27249 sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0);
27251 if( sqlite3_step(pStmt)==SQLITE_ROW ){
27252 tnum = sqlite3_column_int(pStmt, 0);
27253 isWO = sqlite3_column_int(pStmt, 1);
27255 sqlite3_finalize(pStmt);
27257 rc = sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0);
27260 while( rc==SQLITE_OK && sqlite3_step(pStmt)==SQLITE_ROW ){
27262 const char *zCol = (const char*)sqlite3_column_text(pStmt,2);
27265 if( sqlite3_column_int(pStmt,1)==-1 ){
27272 if( isWO && lenPK==0 && sqlite3_column_int(pStmt,5)==0 && zCollist ){
27281 sqlite3_finalize(pStmt);
27828 sqlite3_stmt *pStmt = 0;
27833 "FROM temp.sqlite_parameters;", -1, &pStmt, 0);
27834 if( rx==SQLITE_OK && sqlite3_step(pStmt)==SQLITE_ROW ){
27835 len = sqlite3_column_int(pStmt, 0);
27838 sqlite3_finalize(pStmt);
27839 pStmt = 0;
27843 "FROM temp.sqlite_parameters;", -1, &pStmt, 0);
27844 while( rx==SQLITE_OK && sqlite3_step(pStmt)==SQLITE_ROW ){
27845 oputf("%-*s %s\n", len, sqlite3_column_text(pStmt,0),
27846 sqlite3_column_text(pStmt,1));
27848 sqlite3_finalize(pStmt);
27869 sqlite3_stmt *pStmt;
27877 pStmt = 0;
27878 rx = sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0);
27881 sqlite3_finalize(pStmt);
27882 pStmt = 0;
27887 rx = sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0);
27891 sqlite3_finalize(pStmt);
27892 pStmt = 0;
27896 sqlite3_step(pStmt);
27897 sqlite3_finalize(pStmt);
28163 sqlite3_stmt *pStmt = 0;
28165 -1, &pStmt, 0);
28168 sqlite3_finalize(pStmt);
28174 while( sqlite3_step(pStmt)==SQLITE_ROW ){
28175 const char *zDb = (const char*)sqlite3_column_text(pStmt, 0);
28194 sqlite3_finalize(pStmt);
28481 sqlite3_stmt *pStmt = 0; /* Query against the SELFTEST table */
28516 -1, &pStmt, 0);
28521 -1, &pStmt, 0);
28526 sqlite3_finalize(pStmt);
28529 for(i=1; sqlite3_step(pStmt)==SQLITE_ROW; i++){
28530 int tno = sqlite3_column_int(pStmt, 0);
28531 const char *zOp = (const char*)sqlite3_column_text(pStmt, 1);
28532 const char *zSql = (const char*)sqlite3_column_text(pStmt, 2);
28533 const char *zAns = (const char*)sqlite3_column_text(pStmt, 3);
28572 sqlite3_finalize(pStmt);
28600 sqlite3_stmt *pStmt; /* For querying tables names */
28649 sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0);
28654 while( SQLITE_ROW==sqlite3_step(pStmt) ){
28655 const char *zTab = (const char*)sqlite3_column_text(pStmt,0);
28683 sqlite3_finalize(pStmt);
28732 lrc = sqlite3_prepare_v2(p->db, zRevText, -1, &pStmt, 0);
28738 if( zLike ) sqlite3_bind_text(pStmt,1,zLike,-1,SQLITE_STATIC);
28739 lrc = SQLITE_ROW==sqlite3_step(pStmt);
28741 const char *zGenQuery = (char*)sqlite3_column_text(pStmt,0);
28758 sqlite3_finalize(pStmt);
28867 sqlite3_stmt *pStmt;
28874 rc = sqlite3_prepare_v2(p->db, "PRAGMA database_list", -1, &pStmt, 0);
28876 sqlite3_finalize(pStmt);
28886 sqlite3_finalize(pStmt);
28889 for(ii=0; sqlite3_step(pStmt)==SQLITE_ROW; ii++){
28890 const char *zDbName = (const char*)sqlite3_column_text(pStmt, 1);
28911 rc = sqlite3_finalize(pStmt);
28914 rc = sqlite3_prepare_v2(p->db, s.z, -1, &pStmt, 0);
28924 sqlite3_bind_text(pStmt, 1, azArg[1], -1, SQLITE_TRANSIENT);
28926 sqlite3_bind_text(pStmt, 1, "%", -1, SQLITE_STATIC);
28928 while( sqlite3_step(pStmt)==SQLITE_ROW ){
28937 azResult[nRow] = sqlite3_mprintf("%s", sqlite3_column_text(pStmt, 0));
28941 if( sqlite3_finalize(pStmt)!=SQLITE_OK ){
29750 sqlite3_stmt *pStmt = 0;
29753 shellPrepare(p->db, &rc, zQuery, &pStmt);
29754 if( rc==SQLITE_OK && sqlite3_step(pStmt)==SQLITE_ROW ){
29757 shellFinalize(&rc, pStmt);