Databases: Getting values by column name
Sibylle Koczian
Sibylle.Koczian at Bibliothek.Uni-Augsburg.de
Wed Aug 18 11:00:04 EDT 2004
Robert Ferber schrieb:
>>As other pointed out you have everything you need, using dtuple.py at:
>>
>>http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/81252
>
>
> Of course I looked at that webpage, but if I'm not mistaken, mx.ODBC.Windows
> is only available on Windows which makes it useless for me, I can not find
> a ODBC Package for my Linux distribution and the webpage doesn't give the
> slightest hint what the package name is (which probably would make
> searching for it too easy) or where to get it.
>
I can see no reason why the recipe shouldn't work just as well with
MySQLdb instead of mx.ODBC. And the docstrings for the dtuple classes
state clearly that they work with results "from a DB-API fetch*()
method". No mention of a specific package here.
In fact, the docstring for TupleDescriptor even says "Note: the term
database tuple is rather specific; in actuality the tuple may have come
from non-database sources and/or generated by a process wholly unrelated
to databases."
> My distribution (SUSE) comes with dozens of Python-packages, but none have
> "mx" or "odbc" in their name.
>
But it does come with MySQLdb IIRC.
HTH
Koczian
More information about the Python-list
mailing list