Home » SQL & PL/SQL » SQL & PL/SQL » Closing file using HTP (PL/SQL)
Closing file using HTP [message #296601] Mon, 28 January 2008 06:40 Go to next message
irinaw
Messages: 5
Registered: January 2008
Location: Israel
Junior Member
I wrote a function

CREATE OR REPLACE PROCEDURE GENERATE_UF_EXCEL IS
BEGIN
FOR v_uf_name in (select grp_name from MD_TABLE_GROUPS)
LOOP
PKG_EXPORT_EXCEL.print_group_report(v_uf_name.grp_name);
END LOOP;
END GENERATE_UF_EXCEL;
/

which is calling to attached file

This code is creating excel file with different worksheets
The problem is that I'm calling several time to this function, in order to create different excels, but only the last file is created.
Seems that HTP.INIT deletes other files

How can I deal with it?

Thanks
Re: Closing file using HTP [message #296615 is a reply to message #296601] Mon, 28 January 2008 07:19 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
Why do you use htp to write a file?
Re: Closing file using HTP [message #296616 is a reply to message #296615] Mon, 28 January 2008 07:21 Go to previous messageGo to next message
irinaw
Messages: 5
Registered: January 2008
Location: Israel
Junior Member
I'm using htp because I want to create excel files
Re: Closing file using HTP [message #296634 is a reply to message #296616] Mon, 28 January 2008 08:24 Go to previous messageGo to next message
Michel Cadot
Messages: 64151
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
What is the relation between htp and excel file?

Regards
Michel
Re: Closing file using HTP [message #296636 is a reply to message #296634] Mon, 28 January 2008 08:27 Go to previous messageGo to next message
irinaw
Messages: 5
Registered: January 2008
Location: Israel
Junior Member
I found in forums that it's what should be done in order to create XML, which represents excel
Re: Closing file using HTP [message #296643 is a reply to message #296636] Mon, 28 January 2008 08:41 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
XML does not represent Excel. XML is a markup language used quite generally.
HTP is a package used to generate webpages from PL/SQL.

UTL_FILE is a package that is meant for writing to files
Re: Closing file using HTP [message #297087 is a reply to message #296643] Wed, 30 January 2008 01:45 Go to previous messageGo to next message
irinaw
Messages: 5
Registered: January 2008
Location: Israel
Junior Member
It can't write files localy.
It's writing only to server.

I need my files localy on client.
Re: Closing file using HTP [message #297117 is a reply to message #296601] Wed, 30 January 2008 03:38 Go to previous messageGo to next message
mshrkshl
Messages: 247
Registered: September 2006
Location: New Delhi
Senior Member
set html on
spool local_path\file_name.xls


regards,
Re: Closing file using HTP [message #297120 is a reply to message #297117] Wed, 30 January 2008 03:51 Go to previous messageGo to next message
irinaw
Messages: 5
Registered: January 2008
Location: Israel
Junior Member
where should I add it?
Re: Closing file using HTP [message #297144 is a reply to message #296601] Wed, 30 January 2008 05:31 Go to previous message
mshrkshl
Messages: 247
Registered: September 2006
Location: New Delhi
Senior Member
As you want to store the excel file on a local system, you should use create a procedure (similar to the your procedure) which uses htf-functions instead of the htp-procedures and returning the total content (in a clob). The result can be saved to disk (using utl_file).

Previous Topic: How to give privileges to user?
Next Topic: Can we get the Columns be bold in the EXCEL Sheet when it was opened
Goto Forum:
  


Current Time: Fri Dec 09 23:06:48 CST 2016

Total time taken to generate the page: 0.07561 seconds