Databases: Getting values by column name

Robert Ferber rob at nospam.net
Tue Aug 17 15:52:55 CEST 2004


Hi,

I can't find any good documentation about the Python-database module, all I
found was this rudimentary (no examples, no references) piece here:

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

Anyway, this and also this tutorial here:

http://www.devshed.com/c/a/Python/MySQL-Connectivity-With-Python/2/

only use database rows as sequences, ie as arrays with numerical index.
This gives you loads of problems when using "select *" and also bad code
readability when selecting specific columns.

Is there a way to use them as dictionaries, ie with Index-Strings (=column
names) as indexes?

BTW, is there any good searchable reference to Python's functions, with
examples and cross-references to similar functions?

Thanks a lot,

Robert



More information about the Python-list mailing list