Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> trying to output to file via web using PL/SQL
I'm having a nightmare trying to get this to work. I've had some
direction from this NG but with no sucess. so I apologize for hitting
you all up again for help...but here goes.
I need to send PL/SQL output via the Oracle Web Server to an end user's workstation. I'd like to use the browser to do this, triggering via PL/SQL the "save-as" dialog box on the browser. I've tried a half dozen different approaches, even trying to, as advised on the NG, trick the browser into thinking this is a specific file using a package/procedure name (e.g., fileit.txt).
In any case, here's what I've got. I've left the three owa_util.mime_header calls in place with comments as to what results I get from each. My browser's application settings are set to interpret MIME text/Save-As as a write to disk call.
Any help on this would be greatly appreciated.
Eric Schlene
CREATE OR REPLACE PACKAGE BODY fileit AS
PROCEDURE txt IS
v_func VARCHAR2(10000);
BEGIN
owa_util.mime_header( 'text/save-as' ); -- gives document contains
no data
-- owa_util.mime_header( 'text/plain' ); -- lines as entered, +
<BODY> and </BODY>
-- owa_util.mime_header( 'text/html' ); -- html formatted text
w/o <BODY>...
htp.BodyOpen; v_func := ' This is a test 01 This is a test 02 This is a test 03 This is a test 04 This is a test 05 This is a test 06 '; htp.Print(v_func); htp.BodyClose;