Unix Shell Script with output to CSV File

Hi,

I have a unix shell script that is outputting results from an SQL query to a *.csv file, using utl_file.put_line. The resulting file is then sent out via e-mail as a mail attachment.

The issue I have is that when the mailed attachment is opened in Excel the first column is shown as 2.79341E+11. Expanding the width of the column does not change this. Think the problem is because the selected column is defined as a VARCHAR2 column, but in reality it holds only numeric values.

Any suggestions about how to get the column to display as a text field, some of the values have leading zero's and I need to preserve these.

Thanks in advance.

add double quotes around the numeric field so it is translated as a text value by Excel.