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.


BFILENAME( 'directory', 'filename' )

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;

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

Please Share