** Create a prepared statement using printf-style arguments for the SQL. ** ** This routine is could be marked "static". But it is not always used, ** depending on compile-time options. By omitting the "static", we avoid ** nuisance compiler warnings about "defined but not used". */
| 16099 | ** nuisance compiler warnings about "defined but not used". |
| 16100 | */ |
| 16101 | void shellPreparePrintf( |
| 16102 | sqlite3 *db, |
| 16103 | int *pRc, |
| 16104 | sqlite3_stmt **ppStmt, |
| 16105 | const char *zFmt, |
| 16106 | ... |
| 16107 | ){ |
| 16108 | *ppStmt = 0; |
| 16109 | if( *pRc==SQLITE_OK ){ |
| 16110 | va_list ap; |
| 16111 | char *z; |
| 16112 | va_start(ap, zFmt); |
| 16113 | z = sqlite3_vmprintf(zFmt, ap); |
| 16114 | va_end(ap); |
| 16115 | if( z==0 ){ |
| 16116 | *pRc = SQLITE_NOMEM; |
| 16117 | }else{ |
| 16118 | shellPrepare(db, pRc, z, ppStmt); |
| 16119 | sqlite3_free(z); |
| 16120 | } |
| 16121 | } |
| 16122 | } |
| 16123 | |
| 16124 | /* Finalize the prepared statement created using shellPreparePrintf(). |
| 16125 | ** |
no test coverage detected