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:

Vinish Kapoor
Vinish Kapoor

Vinish Kapoor is a seasoned software development professional and a fervent enthusiast of artificial intelligence (AI). His impressive career spans over 20 years, marked by a relentless pursuit of innovation and excellence in the field of information technology. As an Oracle ACE, Vinish has distinguished himself as a leading expert in Oracle technologies, a title awarded to individuals who have demonstrated their deep commitment, leadership, and expertise in the Oracle community.