Re: HOWTO create in UNIX a *.xlsx (M$ Excel) with data from Oracle (not CSV!)

You could also do it from SQL*Plus if you wanted:

http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:68212348056#15410901253486

Hi Tom,

I know a nice way to make Excel sheets from sqlplus. You can use the markup 
html tag in sqlplus.
Here's an example.

SET LINESIZE 4000
SET VERIFY   OFF
SET FEEDBACK OFF
SET PAGESIZE 999

SET MARKUP HTML ON ENTMAP ON SPOOL ON PREFORMAT OFF

SPOOL c:\temp\test_xls.xls

SELECT    object_type
,         SUBSTR( object_name, 1, 30 ) object
,         created
,         last_ddl_time
,         status
FROM      user_objects
ORDER BY  1, 2
/

SPOOL OFF

SET MARKUP HTML OFF ENTMAP OFF SPOOL OFF PREFORMAT ON

SET LINESIZE 2000 VERIFY ON FEEDBACK ON

Kind regards,

Peter Visscher
Amis Services BV



On 06/22/2010 01:41 PM, Nigel Thomas wrote:

    Is it possible to make a native Excel sheet from UNIX? We need basic
    formatting of the resulting sheet.
    For example the field act_msg is a VARCHAR2 with 4000 Byte. In CSV
    this is a mess...


as well as Perl, you can also use the Apache POI libraries, which give a Java interface (works fine on any platform). See /Apache POI/ - the /Java/ API for Microsoft Documents. <http://poi.apache.org/> I'm using it at the moment, both for reading and writing Excel spreadsheets (xls and xlsx both supported).

HTH

Regards Nigel


Other related posts: