title: How can I set up a SPOOL script in Oracle APEX to export view data as a CSV?
body: <p>I have a view in APEX which I want to export to the drive as a CSV file (which would be picked up by processes from other applications). There is the UTIL_FILE method but it seems much more complex. How can I use SPOOL to export a view as a CSV? I tried this, but it failed to run inside of Apex? So I guess I am not sure about the script itself, but also where to save/schedule it. </p>
  
  <pre><code>spool out.csv
  select '"'|| EVENT_ID || '",' || ENTER_DATE || ',' || START_TIME || ',' || END_TIME || ',' || PLANNED_FLAG || ',' || PURPOSE
   || ',' || TITLE || ',' || SERVICES || ',' || CAUSES || ',' || TICKET_NUM || ',' || OWNER || ',' || DETAILS from DT_FULLVIEW;
  spool off
  exit​
  </code></pre>