That is what I do. But that also means I have to call sqlite_prepare() each time, instead of just once. I was originally hoping I could prepare() once and just bind.
-Dave -----Original Message----- From: Eugene Wee [mailto:[EMAIL PROTECTED] Sent: Sunday, July 10, 2005 12:18 AM To: sqlite-users@sqlite.org Subject: Re: [sqlite] Binding a column name? Hi, Why not construct the SQL statement dynamically in the C/C++ code? That way your statement(s) would have variable column names before compilation. Eugene Wee Brown, Dave wrote: > Actually I doubt it can - since without the column name it can't > create the prepared statement byte code, right? > > -Dave > > -----Original Message----- > From: Brown, Dave [mailto:[EMAIL PROTECTED] > Sent: Saturday, July 09, 2005 8:46 PM > To: sqlite-users@sqlite.org > Subject: [sqlite] Binding a column name? > > > Is it possible for a bind variable to be a column name? I'd like to > make a query which is: > > select <column_name> from MyTable; > > and I'd like the column_name to be a bind variable. This doesn't work > using the straight sqlite3_bind_text() call on the statement "select ? > from MyTable;", which treats the column name as text and not part of > the compiled statement. > > -Dave > >