Tuesday, August 19, 2008

UTL_FILE test

create or replace directory test_dir as '/bie_oraexp';
grant read,write on directory test_dir to robert;

create or replace procedure robert.utl_file_test_write (firstline in varchar2)
is
output_file utl_file.file_type;
begin
output_file := utl_file.fopen ('TEST_DIR','test_file.txt', 'W');
utl_file.put_line (output_file, firstline);
utl_file.fclose(output_file);
end;
/