Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Oracle8i stored procedures - output result to text file
Thanks a lot.
"Peter Johnson" <peter.johnson_at_galexia.com.au> wrote in message news:3A8A0865.5B6B73E5_at_galexia.com.au... CREATE OR REPLACE PROCEDURE HTTP Log Activity (
p FileDir IN VARCHAR2, p FileName IN VARCHAR2) AS DECLARE v FileHandle UTL FILE.FILE TYPE; BEGIN
-- Open the output file
v FileHandle := UTL File.FOPEN(p FileDir,p FileName,'w');
-- Close the opened file
UTL FILE.FCLOSE(v FileHandle);
END xxxxxxx;
UTL FILE.PUTF(v FileHandle,'text to write') function will write to the text file with a filehandle of v FileHandle When using this remember to add '\n' to add the end of line character (where appropriate)
There are many options available here.
Hope that this helps.
Peter Johnson
Sand wrote:
Is there any way I can generate a text file in a stored procedure? Say I
have a query and I want to output the query result to a text file. Is there
any easy way to do this? Thanks.
--
Peter Johnson Email: peter.johnson_at_galexia.com.au Network and Systems Administrator http://www.galexia.com.au Galexia Mobile: +61 412 017 600 Level 1, 3 Montague Street Tel: +61 2 9555 5913 Balmain, NSW 2041 Australia Fax: +61 2 9555 5688
--Received on Wed Feb 14 2001 - 21:39:23 CST