Hi,

in Perl's DBI, I used fetchrow_hashref() to receive a database row as a 
dictionary, with the field names being the dictionary keys.

MySQLdb's fetchone() returns a tuple Unfortunately, I have a dictionary of SQL 
queries which return rows of different lengths (read: with a varying number of 
fields).

The documentation for MySQLdb says that fetchoneDict() is deprecated and the 
usage of fetchone() is suggested.

Is there a recommended way to receive the results of an SQL query in the form I 
need? Or do I have to create a dictionary of fieldname tuples which can be 
zipped with the query result tuple?

Thanks,

Jan
-- 
Any sufficiently advanced technology is indistinguishable from a Perl script. - 
Programming Perl
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to