Re: [sqlite] changing compiled SQL statement

2011-09-13 Thread Richard Hipp
On Tue, Sep 13, 2011 at 4:36 AM, Baruch Burstein wrote: > If I compile a SQL statement, can I immediately change that sql string? > e.g., Is this allowed: > > sql = sqlite3_mprintf("select a from b where c = %Q;", d); > sqlite3_prepare_v2(db, sql, -1, , 0); >

Re: [sqlite] changing compiled SQL statement

2011-09-13 Thread Baruch Burstein
If I compile a SQL statement, can I immediately change that sql string? e.g., Is this allowed: sql = sqlite3_mprintf("select a from b where c = %Q;", d); sqlite3_prepare_v2(db, sql, -1, , 0); sqlite3_step(stmt); strcpy(a, (char *)sqlite3_column_text(stmt, 0)); sqlite3_free(sql); // or sql =

[sqlite] changing compiled SQL statement

2011-09-13 Thread Baruch Burstein
If I compile a SQL statement, can I immediately change that sql string? e.g., Is this allowed: sql = sqlite3_mprintf("select a from b where c = %Q;", d); sqlite3_prepare_v2(db, sql, -1, , 0); sqlite3_step(stmt); strcpy(a, (char *)sqlite3_column_text(stmt, 0)); sqlite3_free(sql); // or sql =