Re: How to get database metadata information (i.e. existing tables and columns in tables)

2006-08-22 Thread Luis M. González
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

Re: How to get database metadata information (i.e. existing tables and columns in tables)

2006-08-22 Thread Steve Holden
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

Re: How to get database metadata information (i.e. existing tables and columns in tables)

2006-08-22 Thread Chris Brat
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 >

Re: How to get database metadata information (i.e. existing tables and columns in tables)

2006-08-22 Thread Miki
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

Re: How to get database metadata information (i.e. existing tables and columns in tables)

2006-08-22 Thread Mathias Waack
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

How to get database metadata information (i.e. existing tables and columns in tables)

2006-08-22 Thread Chris Brat
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