Home » SQL & PL/SQL » SQL & PL/SQL » Formatting using UTL_FILE package (oracle 10g)
Formatting using UTL_FILE package [message #407060] Mon, 08 June 2009 05:42 Go to next message
ashok_lila
Messages: 9
Registered: April 2006
Location: New Delhi
Junior Member

Hi,

I created a excel file using UTL_FILE package.
This file is generating in excel format from RDF.

I can move the data without any formatting like BOLD/ITALIC.

I want to format the data also using this package.

Can anyone tell the way using of that I can format the data in file.

Code:
v_FileID:= Utl_File.Fopen(Location=>'FLS_ORAOUT', FileName=>:p_filename, Open_Mode=>'A', Max_Linesize => 32767);
Utl_File.Put(v_FileID,CHR(9));
Utl_File.Put(v_FileID,CHR(9));
Utl_File.Put(v_FileID,CHR(9)||CHR(9)||:p_report_title);
Utl_File.Putf(v_FileID, '\n');
Utl_File.Putf(v_FileID, '\n');
Utl_File.Put(v_FileID,CHR(9)||CHR(9)||:p_cust_name_no);
Utl_File.Putf(v_FileID, '\n');
Utl_File.Put(v_FileID,CHR(9)||CHR(9)||:p_plant_name);
Utl_File.Putf(v_FileID, '\n');
Utl_File.Put(v_FileID,CHR(9)||CHR(9)||:p_location);
Utl_File.Putf(v_FileID, '\n');
Utl_File.Putf(v_FileID, '\n');
Utl_File.Put(v_FileID,CHR(9)||CHR(9)||'Spare parts Lists');
Utl_File.Putf(v_FileID, '\n');
Utl_File.Putf(v_FileID, '\n');
Utl_File.Putf(v_FileID, '\n');
Utl_File.Putf(v_FileID, '\n');
Utl_File.Putf(v_FileID, '\n');
Utl_File.Fclose(v_FileID);

Where :p_filename = filename.xls

Thanks in advance...

Thanks
Ashok K Gupta
Re: Formatting using UTL_FILE package [message #407069 is a reply to message #407060] Mon, 08 June 2009 06:05 Go to previous messageGo to next message
Michel Cadot
Messages: 68733
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Explain what you mean with "formatting".
Isn't it formatted as far as a csv file can be?

Note that empty lines are useless.

Regards
Michel
Re: Formatting using UTL_FILE package [message #407175 is a reply to message #407069] Mon, 08 June 2009 23:33 Go to previous messageGo to next message
ashok_lila
Messages: 9
Registered: April 2006
Location: New Delhi
Junior Member

Hi Michel,

In PDF I ma getting heading in bold but while I extract them in excel character gets normal not in bold

ID Name

In excel it is printing as
ID NAME

Not in bold.
Re: Formatting using UTL_FILE package [message #407176 is a reply to message #407175] Mon, 08 June 2009 23:38 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
ashok_lila wrote on Mon, 08 June 2009 21:33
Hi Michel,

In PDF I ma getting heading in bold but while I extract them in excel character gets normal not in bold

ID Name

In excel it is printing as
ID NAME

Not in bold.



Forgive me, but this forum is to resolve problems regarding Oracle.
I fail to understand how "not in bold" has anything what so ever in the slightest has to do with Oracle.

As far as we are concerned, you could be using vi, notepad, or any other utility that diddles with text files.

Please clarify why you are bothering us with any problem between you and Adobe PDF files.
Re: Formatting using UTL_FILE package [message #407184 is a reply to message #407060] Tue, 09 June 2009 00:02 Go to previous messageGo to next message
Frank
Messages: 7901
Registered: March 2000
Senior Member
ashok_lila wrote on Mon, 08 June 2009 12:42
I created a excel file using UTL_FILE package.

No you did NOT. You created a comma separated file (csv), which can be read by Excel.
This is not the same as an Excel file. An Excel file typically has a .xls extension and is binary.
Re: Formatting using UTL_FILE package [message #407199 is a reply to message #407175] Tue, 09 June 2009 01:18 Go to previous message
Michel Cadot
Messages: 68733
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
AskTom "Oracle datas into Excell Sheet using pl/sql procedure in Oracle 8i"

Regards
Michel
Previous Topic: pls-00103 (merged)
Next Topic: Count( )
Goto Forum:
  


Current Time: Sat Feb 08 20:53:55 CST 2025