Lines Matching defs:pDb
21813 static char *zAutoColumn(const char *zColNew, sqlite3 **pDb, char **pzRenamed){
21918 assert(pDb!=0);
21921 if( *pDb==0 ){
21922 if( SQLITE_OK!=sqlite3_open(zCOL_DB, pDb) ) return 0;
21925 sqlite3_exec(*pDb,"drop table if exists ColNames;"
21928 rc = sqlite3_exec(*pDb, zTabMake, 0, 0, 0);
21931 assert(*pDb!=0);
21932 rc = sqlite3_prepare_v2(*pDb, zTabFill, -1, &pStmt, 0);
21940 }else if( *pDb==0 ){
21943 /* Formulate the columns spec, close the DB, zero *pDb. */
21945 int hasDupes = db_int(*pDb, zHasDupes);
21946 int nDigits = (hasDupes)? db_int(*pDb, zColDigits) : 0;
21949 rc = sqlite3_exec(*pDb, zDedoctor, 0, 0, 0);
21952 rc = sqlite3_exec(*pDb, zSetReps, 0, 0, 0);
21954 rc = sqlite3_prepare_v2(*pDb, zRenameRank, -1, &pStmt, 0);
21961 assert(db_int(*pDb, zHasDupes)==0); /* Consider: remove this */
21962 rc = sqlite3_prepare_v2(*pDb, zCollectVar, -1, &pStmt, 0);
21974 if( SQLITE_OK==sqlite3_prepare_v2(*pDb, zRenamesDone, -1, &pStmt, 0)
21982 sqlite3_close(*pDb);
21983 *pDb = 0;