title: How does cursor.rowfactory (cx_oracle) work in returning each row in dictionary format?
body: <p>How does that work? I have looked up the documentation. It said the <em>cursor.rowfactory</em> is an attribute letting user define how the format of the row is retrieved. However I don't see any examples to how to define it. Then I found the answer above. I totally lost track and had no idea what that is doing. Can anyone explain what is that doing? What is the attribute <code>.rowfactory</code>? And how <code>makeDictFactory</code> works? What is <code>createRow</code> doing and what <code>args</code> contains?
  Is there some documents I can look up?</p>
  
  <pre class="lang-python prettyprint-override"><code>def makeDictFactory(cursor):
      columnNames = [d[0] for d in cursor.description]
      def createRow(*args):
         return dict(zip(columnNames, args))
      return createRow
  
  curs.rowfactory = makeDictFactory(curs)
  curs.fetchone()
  </code></pre>
  
  <p><a href="https://stackoverflow.com/questions/35045879/cx-oracle-how-can-i-receive-each-row-as-a-dictionary">Code from here</a></p>