This is actually awesome to know, thanks Stephen, I always thought at least 1 step is needed - I'm going to immediately implement this in some functions!

On 2013/12/26 13:30, Stephan Beal wrote:

There are probably a few approaches that would work, but I can think of
none quicker/more efficient than maintaining a list of column names
("SELECT * from t WHERE 1 LIMIT 1" will produce it real quick)
If you want JUST the column names, you can change WHERE 1 to WHERE 0 (and,
optionally, remove the LIMIT). You don't actually need any result rows -
you just need to prepare the statement, and then you can fetch the column
names regardless of whether or not the query would produce any results (you
don't even need to step() it).


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

Reply via email to