开始

前期准备:

SQL> create directory utl as '/home/oracle/test';
Directory created.

SQL> grant execute on utl_file to scott;
Grant succeeded.

SQL> 

文件操作:

declare
  fn utl_file.file_type;
  OutputRecord VARCHAR2(255);
begin

  OutputRecord :='abcdefg';
  fn:=utl_file.fopen('UTL','test.txt','W');

  utl_file.put (fn, OutputRecord);
  utl_file.new_line (OutputFile);

  utl_file.fclose(fn);
end;

结束

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-07
  • 2022-02-22
  • 2022-12-23
  • 2021-10-19
  • 2021-09-09
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案