declare
file_handle UTL_FILE.FILE_TYPE;
begin
file_handle := UTL_FILE.FOPEN('/tmp', '文件名', 'w');
UTL_FILE.PUTF(file_handle, '写入的信息\n');
UTL_FILE.FCLOSE(file_handle);
Exception
WHEN utl_file.invalid_path THEN
raise_application_error(-20000, 'ERROR: Invalid path for file or path not in INIT.ORA.');
end; 
PutF()过程用来以指定格式把文本写入一个文件
Put_Line()过程把一个指定的字符串写入文件并在文件中开始新的一行