Quoting Igor Tandetnik <[EMAIL PROTECTED]>:

> Don't use sqlite3_get_table. Use sqlite3_column_name,
> sqlite3_column_origin_name et al. You can call these on a prepared
> statement without even having to run it, so it doesn't matter whether it
> returns any rows or not.
>
> If all you want is to get column names of one table, see also PRAGMA
> table_info.
>

Thanks for your reply. I'm aware that PRAGMA table_info will allow us  
to read the column names of a particular table. However, we are trying  
to make column names and numbers of arbitrary queries available across  
all database drivers, regardless of whether the query in question  
returns zero or more datasets.

Our sqlite3 driver currently uses sqlite3_get_table() to read the  
results of queries, obviously because it is convenient. I understand  
from your reply that we'd have to switch to the low-level interface  
using prepared statements in order to be able to use  
sqlite3_column_name() et al.

I'm just wondering whether it makes more sense to make  
sqlite3_get_table() consistent and have it return the number of colums  
and their names irrespective of the number of returned rows.

regards,
Markus



-- 
Markus Hoenicka
[EMAIL PROTECTED]
(Spam-protected email: replace the quadrupeds with "mhoenicka")
http://www.mhoenicka.de

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to