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
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?
>
As far as locating the field names goes, this shoul
Thanks for the great feedback.
Chris.
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
>
Hello Chris,
> 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?
Yes and Yes. However some toolkits like SQLObject
(http://www.sqlobje
Chris Brat wrote:
> 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?
Yes.
> Is this dependant on the database?
Yes.
Real databases usually store meta-data (list of ta
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