# BFILENAME function in Oracle

BFILENAME is an advanced function that the Oracle database supports. It is used to get a BFILE locator for a physical LOB binary file. The BFILENAME function is supported in the various versions of the Oracle/PLSQL, including, Oracle 12c, Oracle 11g, Oracle 10g, Oracle 9i and Oracle 8i.

Syntax:

BFILENAME( 'directory', 'filename' )


Parameters:
directory: It is used to specify the directory object to serve as an alias for the full path of the file.
filename: It is used to specify the file name of the file on the file server.

Example :

SELECT BFILENAME ('Dir', 'file.png') FROM dual;

Explanation:
Here, the ‘Dir’ is an already created directory and the ‘file.png’ is the name of the required file.