create or replace directory TO_DIR as '余睁衡D:\TEST'
grant read,write on directory MY_DIR to SCHEMA
grant read,write on directory TO_DIR to SCHEMA
GRANT EXECUTE ON utl_file TO SCHEMA
DECLARE
v_empfile UTL_FILE.FILE_TYPE
v_src_dir VARCHAR2(50) := 'MY_DIR'
v_src_file VARCHAR2(20) := 'test.txt'
v_dest_dir VARCHAR2(50) := 'TO_DIR'
v_dest_file VARCHAR2(50) := 'test1111.txt' --这是我改的地早册方,目标文件名竖做不能和源目标名一样,一样了说明你在逗它玩儿,还有,如果是一样的,会报错且导致源文件丢失
v_replace BOOLEAN := TRUE
BEGIN
UTL_FILE.FRENAME(v_src_dir,v_src_file,v_dest_dir,v_dest_file,v_replace)
END
必须配伍清置Utl_file_dir初始化参数,并保证日志路肆拦径与Utl_file_dir路径一致或者腔雹前是其中一个CREATE OR REPLACE PROCEDURE sp_Write_log(text_context VARCHAR2)
IS
file_handle utl_file.file_type
Write_content VARCHAR2(1024)
Write_file_name VARCHAR2(50)
BEGIN
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)