468,292 Members | 1,454 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,292 developers. It's quick & easy.

Re: how to mysqldb dict cursors

Vaibhav.bhawsar wrote:
I have been trying to get the DictCursor working with mysqldb module but
can't seem to. I have pasted the basic connection code and the traceback
from pydev. The connection does open with the default cursor class.
can't figure this one out. many thanks.
Try one of:

"""
import MySQLdb, MySQLdb.cursors
conn = MySQLdb.connect(..., cursorclass=MySQLdb.cursors.DictCursor)
"""

-or-

"""
import MySQLdb, MySQLdb.cursors
conn = MySQLdb.connect(...)
cur = MySQLdb.cursors.DictCursor(conn)
"""

I'm going off of memory here, though, but I'm at least close.

Paul

Jun 27 '08 #1
0 1423

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Sheila King | last post: by
1 post views Thread by Peter Nikolaidis | last post: by
21 posts views Thread by John Fabiani | last post: by
2 posts views Thread by m0226065 | last post: by
reply views Thread by Wesley Kincaid | last post: by
1 post views Thread by Hector Villafuerte | last post: by
1 post views Thread by Grzegorz Smith | last post: by
reply views Thread by Steve Holden | last post: by
reply views Thread by NPC403 | last post: by
reply views Thread by Teichintx | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.