On Wed, 1 Aug 2007, Terry Carroll wrote:
Does the ? approach not work with PRAGMA commands or something; or am I
doing this wrong?
Just a quick follow-up on this, in case anyone else cares. My conclusion
is that it's not supported. Googling around I found this pysqlite bug
report:
I'm using sqlite for the first time, so I'm not sure whether I'm trying to
do something unsupported. or whether I'm trying to do something that's
supported, but doing it wrong.
I want to get information about a table in my database. The variable
tablename holds the name of the table, and
I'm not sure about PRAGMA, but you can do introspection in sqlite by
examining the table 'sqlite_master'.
--
John.
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
On Thu, 2 Aug 2007, John Fouhy wrote:
I'm not sure about PRAGMA, but you can do introspection in sqlite by
examining the table 'sqlite_master'.
Thanks. That's how I get the table names, actually. But it doesn't give
the column names.
It does give the SQL used to create the table, so I
Terry Carroll wrote:
GET_TABLE_INFO_COMMAND = PRAGMA TABLE_INFO(?)
pragma_cmd = GET_TABLE_INFO_COMMAND
field_data = self.dbconn.execute(pragma_cmd, (tablename))
I get the error:
sqlite3.OperationalError: near ?: syntax error
Some of the variations included using tablename or
On 03/08/07, Terry Carroll [EMAIL PROTECTED] wrote:
On Thu, 2 Aug 2007, John Fouhy wrote:
I'm not sure about PRAGMA, but you can do introspection in sqlite by
examining the table 'sqlite_master'.
Thanks. That's how I get the table names, actually. But it doesn't give
the column names.