[Tutor] MySQLdb field type

Rick Pasotto rick at niof.net
Mon Aug 10 21:52:52 CEST 2009


On Mon, Aug 10, 2009 at 02:50:01PM -0400, Kent Johnson wrote:
> On Mon, Aug 10, 2009 at 1:08 PM, Rick Pasotto<rick at niof.net> wrote:
> > After executing a query that returns values, cursor.description contains
> > a list of tuples, one tuple for each field. Each tuple has seven values
> > consisting of (name,type_code,display_size,internal_size,precision,scale,null_ok).
> >
> > Where can I find a listing of what the various type_codes are? Do I need
> > to experiment and make my own list?
> 
> See the section "Type Objects and Constructors" in the DB-API spec:
> http://dinsdale.python.org/dev/peps/pep-0249/

Not exactly what I'm looking for.

The type_code in the tuple is a number. For one of my tables I see the
following numbers: 1, 2, 10, 252, 253, 254. What I wanted was a listing
telling me which number was which type_code.

-- 
"The dichotomy between personal liberties and property rights is a false
 one. Property does not have rights. People have rights. ... In fact, a
 fundamental interdependence exists between the personal right to liberty
 and the personal right to property." -- Potter Stewart, U.S. Supreme Court
 Justice, Lynch v. Household Finance Corp., 1972
    Rick Pasotto    rick at niof.net    http://www.niof.net


More information about the Tutor mailing list