title: How to get columns names during a SELECT operation that returns zero items in SQLite
body: <p>I'm calling </p>
  
  <pre><code>sqlite3_exec(db, "SELECT a,b,Z FROM t1 WHERE t1.id = 1", func_ptr, arg_ptr)
  </code></pre>
  
  <p>to collect the row content and the column names. I'm trying to create a generic helper function that will take any SELECT command and construct a <code>vector&lt;vector&lt;string&gt;&gt;</code> with the first row containing the column names (and rest containing the contents of the rows).</p>
  
  <p>But this fails to capture the column names when there are no rows to show since <code>func_ptr</code> is only called with one or more rows to display.</p>
  
  <p>How can I get the column names when <code>SELECT</code> returns zero rows?
  EDIT:  I would prefer not to create a level of indirection by creating a table and then calling <code>SELECT</code> on that table. Thanks.
  EDIT:  I would only like to collect what the <code>SELECT</code> statement contains.</p>