title: SQLPLUS query output to *.csv format using java
body: <p>I'm trying to convert SQLPLUS query output to *.csv format by using java code. On executing this spooler.sql on sqlplus getting error as <code>ERROR at line 1:
  ORA-00923: FROM keyword not found where expected</code>
  Can someone help me getting this resolved... knowing the fact that error is in spooler.sql file. Thanks in advance!!!
  Following is my spooler.sql file code</p>
  
  <pre><code>SET LINESIZE 30000
  SET FEEDBACK OFF
  SET SHOW OFF
  SET TRIMSPOOL ON
  SET HEADING OFF
  SET FEED OFF
  SET ECHO OFF
  SPOOL D:\CVS_test.csv
  select regexp_substr (col_code, '[^,]+', 1,1) as "col_code_1" || ',' || regexp_substr (col_code, '[^,]+', 1,2) as "col_code_2" || ',' || col_status   
  from temp_table left join TEMP_MSTR on temp_table.temp_org=TEMP_MSTR.mstr_org and temp_table.temp_acct = TEMP_MSTR.mstr_acct;
  SPOOL OFF
  EXIT
  </code></pre>