Home » PLSQL » UTL_FILE.FREMOVE Example: Delete a File in Oracle

UTL_FILE.FREMOVE Example: Delete a File in Oracle

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

locationDirectory location of the file. (Directory Object Name)
filenameName 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;
/

Reference:

See also: