UTL_FILE -
This allows PL/Sql to output to a flat file.
The directories to be accessed need to be set up in init.ora
UTL_FILE_DIR =
(1 line for each directory, each line must be next to the other)
UTL_FILE_DIR=* (any directory) or UTL_FILE_DIR='.' (current directory) is not recommended by Oracle.
Warning: This can override operating system permissions.
Example of use
If there are any problems:
Check file permissions on utl directories.
Check user permissions (execute procedure).
Check utl_file_dir are set up correctly in init.ora.
declare
l_file UTL_FILE.FILE_TYPE;
l_buff varchar2(2000);
begin
l_file := utl_file.fopen('/hoem/transmgr/rics/reports','joe.lst','w');
l_buff := 'printed line';
utl_file.put_line(l_file,l_buff);
utl_file.fclose(l_file);
end;