mxODBC question

Scott Hathaway slhath at home.com
Sun Feb 11 22:55:31 CET 2001


I am using mxODBC to access db's with no problem, but I have a question.  If
I use a sql call as follows:

select username from users;

Then, I make a call as follows:

data = c.fetchall()

Then, to access the first value of the first (and only) field, I have to
use:

theValue = data[0][0]

This is ugly.  Is there a way to do something like:

theValue = data[0]['firstname']

Or anything more easy to discern for code readability?

Thanks,
Scott





More information about the Python-list mailing list