Mapping Column Names to results using DBI

Aahz Maruch aahz at netcom.com
Wed Jan 19 17:44:06 EST 2000


In article <38863BEB.BCB9E15C at exceptionalminds.com>,
Timothy Grant  <tjg at avalongroup.net> wrote:
>
>As you know, the results from a database query are returned in a tuple.
>I can access those results by position just fine, is it possible to map
>the column names onto the results, so I can access columns by name
>rather than by number?
>
>While indexing by number works, it is incredibly fragile and will start
>failing the minute the underlying DB changes.

Try "SELECT x, y, z" instead of "SELECT *".
--
                      --- Aahz (@netcom.com)

Androgynous poly kinky vanilla queer het    <*>     http://www.rahul.net/aahz/
Hugs and backrubs -- I break Rule 6

Have a *HAPPY* day!!!!!!!!!!



More information about the Python-list mailing list