How to move file from one directory to another directory in PLSQL
procedure xx_move_file_to_archive_dir(p_file_name in varchar2)
is
begin
debug_msg_prc(chr(10)||'-----Start xx_move_file_to_archive_dir: To Move same name file to archive if exists.',g_log);
debug_msg_prc( 'Source Path:'||g_directory_path_out||',Target Path:'||g_directory_path_archive ||',FileName:'||p_file_name,g_log);
UTL_FILE.FRENAME (g_directory_path_out,--source
p_file_name,
g_directory_path_archive,--target archive
p_file_name||'ar',--new archive file name
TRUE);
debug_msg_prc('FileName:'||p_file_name ||' move to archive directory',g_log);
exception when others then
debug_msg_prc('Error xx_move_file_to_archive_dir.Seems File not available to move. '||substr(SQLERRM,1,200),g_log);
end xx_move_file_to_archive_dir;
No comments:
Post a Comment