Documentation Home
MySQL Connector/Python Developer Guide
Related Documentation Download this Manual
PDF (US Ltr) - 0.7Mb
PDF (A4) - 0.7Mb


MySQL Connector/Python Developer Guide  /  Connector/Python C Extension API Reference  /  _mysql_connector.MySQL.fetch_fields() Method

11.15 _mysql_connector.MySQL.fetch_fields() Method

Syntax:

field_info = ccnx.fetch_fields()

Fetches column information for the active result set. Returns a list of tuples, one tuple per column

Raises a MySQLInterfaceError exception for any MySQL error returned by the MySQL server.

ccnx.query('SELECT CURRENT_USER(), 1 + 3, NOW()')
field_info = ccnx.fetch_fields()
for fi in field_info:
  print(fi)
ccnx.consume_result()