If you want to know the names of the fields on a recordset, you can use
cursor.description.
For example, lets say you have a connection to a MySQL database:
con = MySQLdb.connect('localhost','root','','mydb')
cur = con.cursor()
cur.execute('select * from customers')
result = cur.fetchall()
fields = [i[0] for i in cur.description]
...
Description gives a list with information about your recordset, being
the first item the name of the field.
Hope this helps...
Luis
Chris Brat wrote:
> Hi,
>
> Is it possible to retrieve details about the database, specifically a
> list of the tables in the database; and then to retrieve the columns
> and their types for the tables?
>
> Is this dependant on the database?
>
> Thanks
> Chris
--
http://mail.python.org/mailman/listinfo/python-list