Home » SQL & PL/SQL » SQL & PL/SQL » Exporting Oracle data into excel file with auto column size of the data
Exporting Oracle data into excel file with auto column size of the data [message #279234] Wed, 07 November 2007 07:49 Go to next message
SRISREENATH
Messages: 13
Registered: January 2006
Junior Member
Hi,

My name is Sreenath.

I want to export the oracle data into an excel sheet. I have written the code by using UTL_FILE package. but i am getting the output as shown in the screen shot(without formatting the column size as the width of the data it has). But I want the output column width to be set according to the size of the data automatically.


Please can any body throw some idea on it.

Thanks
Sreenath.
  • Attachment: sample1.jpg
    (Size: 76.21KB, Downloaded 790 times)
Re: Exporting Oracle data into excel file with auto column size of the data [message #279235 is a reply to message #279234] Wed, 07 November 2007 07:52 Go to previous messageGo to next message
pablolee
Messages: 2835
Registered: May 2007
Location: Scotland
Senior Member
You will not be able to do this via pl/sql. A quick macro on the on open event of your Excel ss should do it tho'
(the vba code would be
Columns.AutoFit
)

[Updated on: Wed, 07 November 2007 07:55]

Report message to a moderator

Re: Exporting Oracle data into excel file with auto column size of the data [message #377600 is a reply to message #279234] Tue, 23 December 2008 16:20 Go to previous messageGo to next message
kumarbo7
Messages: 19
Registered: March 2008
Location: New Jersey
Junior Member
Sreenath,

Could you please share your thoughts ,how to write a UTL_FILE to export table data into excel.

Thanks in advance
Kumar
Re: Exporting Oracle data into excel file with auto column size of the data [message #377604 is a reply to message #279234] Tue, 23 December 2008 17:00 Go to previous messageGo to next message
coleing
Messages: 213
Registered: February 2008
Senior Member
you can definatelely do this if you utilise XML spreadsheets when generating your file.

As for auto-sizing, all you need to do it take a look at the XML schema document to get the correct syntax for the cell formatting.

( or just do what I do, create a small xml spreadsheet with the formatting you require and look at the xml document in notepad to see the tags required).

Check out this website for a ready made example of XML spreadsheets from plsql.

http://matzberger.de/oracle/spreadsheet-en.html

EDIT:

Added another plsql-xml spreadsheet reference.

http://sanjeev-oracle-world.blogspot.com/

[Updated on: Tue, 23 December 2008 17:09]

Report message to a moderator

Re: Exporting Oracle data into excel file with auto column size of the data [message #485448 is a reply to message #279234] Wed, 08 December 2010 02:23 Go to previous messageGo to next message
pavanivnc
Messages: 6
Registered: December 2010
Junior Member
Hi,


Can you please send the sample code to export data into excel.


Pavani.
Re: Exporting Oracle data into excel file with auto column size of the data [message #485491 is a reply to message #485448] Wed, 08 December 2010 09:47 Go to previous message
Michel Cadot
Messages: 64139
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
See the topic you created for that.

http://www.orafaq.com/forum/m/485461/102589/#msg_485461

Regards
Michel
Previous Topic: Checking users input
Next Topic: Change datatype from Object
Goto Forum:
  


Current Time: Fri Dec 09 02:17:53 CST 2016

Total time taken to generate the page: 0.05752 seconds