In Oracle PL/SQL, UTL_FILE.FREMOVE procedure is used to delete a file from the disk. This tutorial explains how to delete a file in Oracle PL/SQL using UTL_FILE.FREMOVE procedure with syntax and example.
Syntax
UTL_FILE.FREMOVE ( location IN VARCHAR2, filename IN VARCHAR2);
Parameters
location | Directory location of the file. (Directory Object Name) |
filename | Name of the file to be deleted. |
UTL_FILE.FREMOVE Example
The following example will delete the file sqllog2.log from the MY_DOC directory.
BEGIN UTL_FILE.fremove ('MY_DOC', 'sqllog2.log'); END; /