In Tcl, the following command will give you a list of column names of table.

set sStuff [lindex [db1 eval " pragma table_info($sTable)" {lappend
sNameList $name}] 0]  

-----Original Message-----
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of ve3meo
Sent: Sunday, 28 February 2010 05:46
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] Retrieving column names


"P Kishor" <punk.k...@gmail.com> wrote in message
news:cdf6db501002270448s2d28ef4fm9a831fdfa7bf3...@mail.gmail.com...
> On Sat, Feb 27, 2010 at 6:43 AM, Peter Rodwell <pe...@gedackt.org> 
> wrote:
>> I'm sure this question has been asked and answered a million times, 
>> but I've not been able to find the answer. Googling for it has turned 
>> up lots of answers, none of which seem to work with SQLite:
>
>
> http://www.google.com/search?q=sqlite+column+names
>
> The top four answers returned all explain how to do the above correctly.
>
> Use PRAGMA, or SELECT from sqlite_master
>

Is there a way to use SELECT against the PRAGMA result-set?

This returns an error:
SELECT * FROM (PRAGMA table_info(tablename)); 



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

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

Reply via email to