Re: [sqlite] Column headers of result

2009-07-05 Thread Dennis Cote
BareFeet wrote: > > >>> How can I get just the column headers without all the result rows? >>> >> Turn headers on, then perform a search which gives no results. >> > > Unfortunately, the sqlite3 command line tool does not show the headers > when there are no result rows. > >

Re: [sqlite] Column headers of result

2009-07-04 Thread Simon Slavin
On 5 Jul 2009, at 2:35am, BareFeet wrote: > Hi Simon, Just a reminder that you're posting to a list, not to me personally. >> What are you trying to do ? Find all the columns in a TABLE or find >> all the columns in an arbitrary SELECT ? If it's the former use >> PRAGMA table_info for the

Re: [sqlite] Column headers of result

2009-07-04 Thread BareFeet
Hi Simon, >> In any case, it's not possible to convert an ad hoc query (ie not >> known beforehand) into one that returns no rows. > > Sure it is. Just add 'WHERE 1=2' to it if there's no WHERE clause, > or 'AND 1=2' if there is. Increasing potential complexity of the "ad hoc" SQL command

Re: [sqlite] Column headers of result

2009-07-04 Thread BareFeet
Hi Simon, How can I get just the column headers without all the result rows? >>> >>> Turn headers on, then perform a search which gives no results. >> >> Unfortunately, the sqlite3 command line tool does not show the >> headers >> when there are no result rows. In any case, it's nit

Re: [sqlite] Column headers of result

2009-07-04 Thread Simon Slavin
On 5 Jul 2009, at 12:31am, BareFeet wrote: > Hi Simon, > >>> How can I get just the column headers without all the result rows? >> >> Turn headers on, then perform a search which gives no results. > > Unfortunately, the sqlite3 command line tool does not show the headers > when there are no

Re: [sqlite] Column headers of result

2009-07-04 Thread Simon Davies
2009/7/5 BareFeet : >>> > Hi Simon, > >>> How can I get just the column headers without all the result rows? >> >> Turn headers on, then perform a search which gives no results. > > Unfortunately, the sqlite3 command line tool does not show the headers > when there are no

Re: [sqlite] Column headers of result

2009-07-04 Thread BareFeet
>> Hi Simon, >> How can I get just the column headers without all the result rows? > > Turn headers on, then perform a search which gives no results. Unfortunately, the sqlite3 command line tool does not show the headers when there are no result rows. In any case, it's nit possible to

Re: [sqlite] Column headers of result

2009-06-29 Thread Simon Slavin
On 29 Jun 2009, at 1:05pm, BareFeet wrote: > How can I get just the column headers without all the result rows? Turn headers on, then perform a search which gives no results. It's difficult in the command-line tool, but easy using function calls since there's a function call specially

Re: [sqlite] Column headers of result

2009-06-29 Thread BareFeet
Thanks Jens and John for your replies. Yes, I am familiar with the "headers on" option. Sorry, I should have mentioned. However, that prepends the headers to the result rows. It would also be ambiguous if a column header contains a pipe or quote or newline (which is unlikely but possible).

Re: [sqlite] Column headers of result

2009-06-29 Thread John Machin
On 29/06/2009 2:57 PM, BareFeet wrote: > Hi, > > Is there any way in the command line to get the columns in a query > result? > > For example, given an ad-hoc SQL command, such as: > > begin; > insert into MyTableOrView select * from SomeSource; > select * from MyTableOrView join

Re: [sqlite] Column headers of result

2009-06-29 Thread Jens Miltner
Am 29.06.2009 um 06:57 schrieb BareFeet: > Hi, > > Is there any way in the command line to get the columns in a query > result? > > For example, given an ad-hoc SQL command, such as: > > begin; > insert into MyTableOrView select * from SomeSource; > select * from MyTableOrView join

[sqlite] Column headers of result

2009-06-28 Thread BareFeet
Hi, Is there any way in the command line to get the columns in a query result? For example, given an ad-hoc SQL command, such as: begin; insert into MyTableOrView select * from SomeSource; select * from MyTableOrView join SomeOtherTableOrView where condition; end; how can I get the column