mxODBC question

Scott Hathaway slhath at
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

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?


More information about the Python-list mailing list