UTL_FILE [message #171599] |
Wed, 10 May 2006 09:11 |
brandointheweb
Messages: 25 Registered: August 2005 Location: Germany
|
Junior Member |
|
|
Hello from Germany,
I try to use the UTL_FILE function!
The main thing I#m interested in is to write the result of my View to a certain .txt-file!
But as I'm quite new with this I first tried following:
UTL_FILE_DIR = E:\Digital_Data\TEST
DECLARE
v_file UTL_FILE.FILE_TYPE;
i NUMBER;
BEGIN
--UTL_FILE_DIR = E:\Digital_Data\TEST
v_file := UTL_FILE.FOPEN('E:\DIGITAL_DATA\TEST','test.txt', 'w');
UTL_FILE.PUT_LINE(v_file,' Überschrift');
UTL_FILE.NEW_LINE (v_file);
For i IN 1..10 LOOP
--UTL_FILE.PUT_LINE(v_file,'Erste Zeile');
--....
UTL_FILE.PUT_LINE(v_file,TO_CHAR(i) || '-te Zeile');
END LOOP;
UTL_FILE.FCLOSE(v_file);
END;
But as I do this I get following errors:
ORA-29280: Ungültiger Verzeichnispfad
ORA-062512: in "SYS.UTL_FILE", Zeile 18
ORA-06521: in "SYS.UTL_FILE", Zeile 424
Can someone give me an hint whats wrong or how to solve my wish to write my view to a file?!
Thanks and regards
Marlon
|
|
|
|
|
|
|
Re: UTL_FILE [message #172358 is a reply to message #172294] |
Tue, 16 May 2006 03:23 |
|
Mahesh Rajendran
Messages: 10708 Registered: March 2002 Location: oracleDocoVille
|
Senior Member Account Moderator |
|
|
UTL_FILE_DIR outdated and not recomended to use.
UTL_FILE_DIR is still there. It is upto you to use it. But never call Oracle support if you have any problems with it.
REFER DOCUMENTATION for 9i that is released atleast 4 years before.
http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96612/u_file.htm#998101
Quote: |
In the past, accessible directories for the UTL_FILE functions were specified in the initialization file using the UTL_FILE_DIR parameter. However, UTL_FILE_DIR access is not recommended. It is recommended that you use the CREATE DIRECTORY feature, which replaces UTL_FILE_DIR. Directory objects offer more flexibility and granular control to the UTL_FILE application administrator, can be maintained dynamically (that is, without shutting down the database), and are consistent with other Oracle tools. CREATE DIRECTORY privilege is granted only to SYS and SYSTEM by default.
Note:
use the CREATE DIRECTORY feature instead of UTL_FILE_DIR for directory access verification.
|
|
|
|