Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Header formatting while spooling an excel file

User_B9XGOJul 6 2017 — edited Jul 8 2017

Hi All,

I am spooling my sql output to an excel file and below is the code.

I am using custom package to spool the query.

l_heading :=

               'Empno'                            

            || ','                                    

            || '1234'            

            || CHR(10)

            || 'Ename'

            || ','

            || 'SCOTT' ;

--- ',' is the delimiter which is nothing but CHR(9) i.e tab

Expected O/P:

Empno

1234

Ename

SCOTT

I am getting the below O/P:

   

Empno1234
EnameSCOTT

Empno

1234
Ename

SCOTT

I tried CHR(10) , CHR(13) || CHR(10) for a new line value. But, this splits the line within the cell.

Whereas, I want to print Ename on the next row of the excel.

Can anyone please help.

Thanks.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 5 2017
Added on Jul 6 2017
7 comments
2,758 views