http://metalink.oracle.com/metalink/plsql/ml2_documents.showNOT?p_id=206272.1 Using the new method CREATE DIRECTORY in place of the old way of using UTL_FILE_DIR does not necessarily need code change, even though the first argument to the fopen function is no longer the physical path to the directory object name. The trick is to use a directory name that is named the same as the physical path and surround the name with double quotes. But used in utl_file.fopen, you continue to use single quotes. The practical use of this trick may be preserving existing PL/SQL code to reduce maintenance cost while taking advantage of the new CREATE DIRECTORY feature at the same time (no need to bounce database for a directory change, for instance). But I don't know how long Oracle allows us to use this trick. This of course works (normal way, as documented): create directory mytest as 'c:\temp'; grant read on directory mytest to public; create or replace function f1 return number is v_output_file1 utl_file.file_type; begin v_output_file1 := utl_file.fopen('MYTEST', 'NEW.txt', 'a'); utl_file .put_line(v_output_file1, 'NATURE and Beauty'); utl_file.fclose_all; return 1; end; / var x number exec :x := f1 This does NOT work (/ is not allowed as directory name on Windows): drop directory "/whatever/dontcare"; create directory "/whatever/dontcare" as 'c:\temp'; grant read on directory "/whatever/dontcare" to public; create or replace function f1 return number is v_output_file1 utl_file.file_type; begin v_output_file1 := utl_file.fopen('/whatever/dontcare', 'NEW.txt', 'a'); utl_file .put_line(v_output_file1, 'NATURE and Beauty'); utl_file.fclose_all; return 1; end; / var x number SQL> exec :x := f1 BEGIN :x := f1; END; * ERROR at line 1: ORA-29280: invalid directory path ORA-06512: at "SYS.UTL_FILE", line 18 ORA-06512: at "SYS.UTL_FILE", line 424 ORA-06512: at "SYS.F1", line 4 ORA-06512: at line 1 But this works: SQL> conn / as sysdba Connected. SQL> select * from v$version; BANNER ---------------------------------------------------------------- Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production PL/SQL Release 9.2.0.1.0 - Production CORE 9.2.0.1.0 Production TNS for 32-bit Windows: Version 9.2.0.1.0 - Production NLSRTL Version 9.2.0.1.0 - Production SQL> create directory "c:\temp" as 'c:\temp'; Directory created. SQL> grant read on directory "c:\temp" to public; Grant succeeded. SQL> create or replace function f1 return number is 2 v_output_file1 utl_file.file_type; 3 begin 4 v_output_file1 := utl_file.fopen('c:\temp', 'NEW.txt', 'a'); 5 utl_file .put_line(v_output_file1, 'NATURE and Beauty'); 6 utl_file.fclose_all; 7 return 1; 8 end; 9 / Function created. SQL> var x number SQL> exec :x := f1 PL/SQL procedure successfully completed. SQL> host type c:\temp\NEW.txt NATURE and Beauty SQL> show parameter utl_file_dir NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ utl_file_dir string And on UNIX, this also works (tested on dbvrfy1.ea.com, Solaris 2.8): ... Enter user-name: / as sysdba Connected to: Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production With the Partitioning, OLAP and Oracle Data Mining options JServer Release 9.2.0.3.0 - Production SQL> set pages 100 SQL> create directory '/tmp' as '/tmp'; create directory '/tmp' as '/tmp' * ERROR at line 1: ORA-22929: invalid or missing directory name SQL> create directory "/tmp" as '/tmp'; Directory created. SQL> grant read on directory "/tmp" to public; Grant succeeded. SQL> create or replace function f1 return number is 2 v_output_file1 utl_file.file_type; 3 begin 4 v_output_file1 := utl_file.fopen('/tmp', 'NEW.txt', 'a'); 5 utl_file .put_line(v_output_file1, 'NATURE and Beauty'); 6 utl_file.fclose_all; 7 return 1; 8 end; 9 / Function created. SQL> var x number SQL> exec :x := f1 PL/SQL procedure successfully completed. SQL> ! $ cd /tmp $ more NEW.txt NATURE and Beauty /tmp>exit SQL> select value from v$parameter where name = 'utl_file_dir'; VALUE --------------------------------------------------------------- /eacom/hyb006/oradump/edump