Usually we get requirements to move files from one location to another. The most easy option we think of for this purpose is through shell script, but there is a simple pl/sql api which can do this job easily for us.
You must have heard about UTL_FILE utility provided by oracle. We can use this utility for moving our files from one locatio to another. It has some limitations as well, such as the directory structure used by it should be in the UTL_FILE_PATH in init.ora or Directory object should exist for that path
The following code/Script can be used for Copying the file:
Utl_File.Fcopy ( src_location => p_file_location
,src_filename => p_file_name
, dest_location => p_arch_location,
dest_filename => p_arch_file );
The following code/Script can be used for removing the file:
UTL_FILE.Fremove(p_file_location,lc_datafile_name);
ليست هناك تعليقات:
إرسال تعليق