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:

Get more Vinish.dev tutorials on Google

See my articles more often when you search Google.

Vinish Kapoor
Vinish Kapoor

An Oracle ACE, author of four books on Oracle APEX, SQL and PL/SQL, and Oracle Forms, and a software developer building Oracle database applications since 2001.

guest

0 Comments
Oldest
Newest Most Voted