title: Fetching huge data from Oracle in Python
body: <p>I need to fetch huge data from Oracle (using cx_oracle) in python 2.6, and to produce some csv file.</p>
  
  <p>The data size is about 400k record x 200 columns x 100 chars each. </p>
  
  <p>Which is the best way to do that? </p>
  
  <p>Now, using the following code...</p>
  
  <pre><code>ctemp = connection.cursor()
  ctemp.execute(sql)
  ctemp.arraysize = 256
  for row in ctemp:
    file.write(row[1])
    ...
  </code></pre>
  
  <p>... the script remain hours in the loop and nothing is writed to the file... (is there a way to print a message for every record extracted?)</p>
  
  <p>Note: I don't have any issue with Oracle, and running the query in SqlDeveloper is super fast.</p>
  
  <p>Thank you, gian</p>