Jon Drnek wrote:
Is there a way that I can find out the number of a given column name in the
query?
Instead of
ts.key = sqlite3_column_int(preparedGet,0);
I'd like to do something like:
ts.key = sqlite3_column_int(preparedGet,get_column_id(preparedGet,"id"));
Is there a way to do that?
Jon,
I don't believe there is any API function to do that for columns (but
you can do it for bound parameters).
You would have to build your own map from the name to the index number
after preparing the statement. You can use the sqlite3_column_count
function to get the number of columns, and then loop calling
sqlite3_column_name to get al the names once. If you save those names
along with the associated index, you can then use that table (or an STL
map if you are using C++) to translate from a column name back to its
column index for use with the other sqlite3_column_* API functions.
HTH
Dennis Cote
-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------