-1

Possible Duplicate:
Create an Excel Spreadsheet from a Oracle Database
Writing in ExcelSheet using UTL_FILE package in Oracle

I am generating CSV file with the UTIL_File package.

Now I would like to format the header in bold when it is opened in MS Excel.

Is there any way to do that using PL/SQL and Oracle 9i?

Thanks

1
  • 1
    CSV files acnnot contain formatting, just data in plain text. Oracle has no built-ins to export data to Oracle's proprietary format but other people have written extensions. See my answer in the thread I have proposed as a duplicate, as it suggests several different options for you. Commented Jul 17, 2012 at 11:30

2 Answers 2

3

CSV is a plain-text format, it does not allow for any formatting information. If formatting is a must, you could try creating an XML Excel file: http://blogs.msdn.com/b/brian_jones/archive/2005/06/27/433152.aspx

Be aware that this is quite a bit more complicated than creating a CSV file, but it will allow you to create a file that contains formatting information.

Sign up to request clarification or add additional context in comments.

Comments

3

A csv file is a plain text document, without any formatting. So by definition it is not possible to open a csv file in excel and have the headers in bold.

You could write a vba macro in Excel that opens the csv file, copies the content to an excel sheet and applies whatever formatting you require.

4 Comments

actualy i m generating csv file and keeping it in some folder ,from there java has to attach this file to mail and send. Now tell me how can i do that... I m bit new to PL/SQL. Thanks
You can't include formatting in a csv file. If you want some formatting, you need to use a different file format.
but in that case how can i generate xls or anything using Oracle 9i Can we do the same using UTIL_FILE.
I don't know oracle well enough to answer that. Since you read the file from java, you can use the apache-poi library or a similar tool to create an excel file from the csv file, including the required formatting. See this tutorial for an example.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.