** 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". */
| 21852 | ** nuisance compiler warnings about "defined but not used". |
| 21853 | */ |
| 21854 | void shellPreparePrintf( |
| 21855 | sqlite3 *db, |
| 21856 | int *pRc, |
| 21857 | sqlite3_stmt **ppStmt, |
| 21858 | const char *zFmt, |
| 21859 | ... |
| 21860 | ){ |
| 21861 | *ppStmt = 0; |
| 21862 | if( *pRc==SQLITE_OK ){ |
| 21863 | va_list ap; |
| 21864 | char *z; |
| 21865 | va_start(ap, zFmt); |
| 21866 | z = sqlite3_vmprintf(zFmt, ap); |
| 21867 | va_end(ap); |
| 21868 | if( z==0 ){ |
| 21869 | *pRc = SQLITE_NOMEM; |
| 21870 | }else{ |
| 21871 | shellPrepare(db, pRc, z, ppStmt); |
| 21872 | sqlite3_free(z); |
| 21873 | } |
| 21874 | } |
| 21875 | } |
| 21876 | |
| 21877 | /* Finalize the prepared statement created using shellPreparePrintf(). |
| 21878 | ** |
no test coverage detected