[Tutor] SQL headache with column

Danny Yoo dyoo at hkn.eecs.berkeley.edu
Tue Jul 19 22:31:44 CEST 2005


> 	oResult = oCursor.execute( "SHOW COLUMNS FROM " + sTableName + "" )

Hi Bernard,

Try using oCursor.fetchall() after the execution.  The return value of
execute() are the number of rows affected, and you can then pull each
fetched value by using either oCursor.fetchone() or oCursor.fetchall().

See:

    http://python.org/peps/pep-0249.html

for more details about this.  Hope this helps!



More information about the Tutor mailing list