title: How to output oracle query result into a text file in windows?
body: <p>The query will produce a <strong>large data set</strong> <strong>(4 columns and ~ 6 million rows)</strong>. I tried the query below on smaller data but it wrote the query itself to the text file not the query results:</p>
  
  <pre><code>spool test.txt
  SELECT a.ID, a.COLOR,a.TYPE,b.DESC
  FROM TABLE_1 a
  left join TABLE_2 b on a.ID=b.ID
  spool off
  </code></pre>
  
  <p>what's the most efficient way to extract the data above from the Oracle database? I will be running the query in Production database and would like to extract the data in the most efficient way. Other than <code>spool</code> function, anything else to try?</p>