title: Excel file generation using SQL query, SPOOL command in Shell script
body: <p>I have to generate excel file from tables from <code>Oracle Database</code>. The code is working fine but however the column names are not coming completely, there are just coming as the length of there data length.
  I want complete header/column names</p>
  
  <p>The column names are coming like this</p>
  
  <pre><code>ST  STAT_TYPE_DESC   ST  S  NXT_STATME  DELAY_DAYS  ANN_PREM_LIM_LOW ANN_PREM_LIM_HI    CONTRIB_HIST_LEN    EVENT_DO    C   P
  </code></pre>
  
  <p>But I want is complete names of the columns, for example <code>ST</code> is <strong>STATEMENT_TYPE_ID</strong></p>
  
  <pre><code>#!/bin/ksh
  FILE="A.csv"
  
  sqlplus -s lifelite/lifelite@dv10  &lt;&lt;EOF
  
  SPOOL $FILE
  SET HEADING ON
  SET HEADSEP OFF
  SET FEEDBACK OFF  
  SET LINESIZE 250
  SET PAGESIZE 5000 embedded ON
  SET COLSEP ","
  
  SELECT * FROM TLLI_01150STATTYPE;
  EOF
  SPOOL OFF
  EXIT 0
  </code></pre>