0

我的包代码包含 fnd_file.put_line 用于记录目的。我需要用 utl_file.put_line 替换它,这将是我应该编写的最少代码行。我的代码中有 14 个过程的 fnd_file.put_line 出现了 100 多次。请解释 utl_file 和 fnd_file 有什么区别?并给我示例代码。

我的问题是:

您能否解释一下代码是否在服务器上,然后如何提供目录位置。它还将包括服务器详细信息。请用例子说明。

PS:我可以看到这个包是并发编程的一部分。 utl_file 在范围内吗?

4

1 回答 1

1

FND_FILE.PUT_LINE, 当您运行并发程序时,将在输出或 LOG 文件中打印字符串。

FND_FILE.PUT_LINE(FND_FILE.output, 'message'); -- This will print in Concurrent program output
FND_FILE.PUT_LINE(FND_FILE.log, 'message'); -- This will print in Concurrent program log

UTL_FILE.PUT_LINE将在可写文件中打印字符串,您需要在 pl-sql 中打开该文件。

使用 UTL_FILE 的示例

v_chr_out_file       UTL_FILE.file_type;
v_chr_out_file :=
            UTL_FILE.fopen (<directory_path>,
                            <file_name>,
                            'W',
                            32767);
UTL_FILE.put_line (v_chr_out_file, 'this will get written in file');
UTL_FILE.fclose (v_chr_out_file);
于 2017-07-25T12:39:18.263 回答