cr.dictfetchall()will provide you with all the relevant entries in the form of a ** dictionary list ** containing the key , value .
cr.dictfetchone()works the same as cr.dictfetchall()except that it returns only one record.
cr.fetchall()will provide you with all relevant entries in the form of a tupple list .
cr.fetchone()works the same as cr.fetchall()except that it returns only one record.
In your request, if you use:
cr.dictfetchall()will provide you [{'reg_no': 123},{'reg_no': 543},].cr.dictfetchone()will provide you {'reg_no': 123}.cr.fetchall() will give you "[(123), (543)]."cr.fetchone() will give you "(123)".
source
share