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: [email protected]
[mailto:[email protected]] On Behalf Of ve3meo
Sent: Sunday, 28 February 2010 05:46
To: [email protected]
Subject: Re: [sqlite] Retrieving column names


"P Kishor" <[email protected]> wrote in message
news:[email protected]...
> On Sat, Feb 27, 2010 at 6:43 AM, Peter Rodwell <[email protected]> 
> 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
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to