:: Forum >>

how can i save file in DB Server

Hi,
Can anyone plz tell me how to place the files in the db server?
We have a procedure to generate an xml. We are trying to place it in a folder. when I give an existing folder('/public/nowyfolder') it gives an error.
I tried to create a folder using

CREATE OR REPLACE DIRECTORY sys_dir AS 'D:\tsxml'
it is giving a msg ORA-01031: insufficient privileges.
Kindly let me know how to access a UTIL FILE on the server.
It also gave an error.
The proc is as follows.
-------------------------------------------------------------------------------------------------------------------------------
BEGIN

dbms_output.put_line('inside the fileopen');
fileHandler := UTL_FILE.FOPEN('/public/nowyfolder', FileName, 'w');
dbms_output.put_line('after writing to file');
UTL_FILE.PUTF(fileHandler, xmlString);
UTL_FILE.FCLOSE(fileHandler);
dbms_output.put_line('fileclosed');
EXCEPTION
WHEN utl_file.invalid_path THEN
INSERT INTO TS_Data_Trace(Creation_Date,xml_data) VALUES(sysdate,'Failed in Spooling');

END;
Adam
Monday, May 16, 2005

This topic is archived.


Back to support forum

Forum search