|Oracle® Database SQL Reference
10g Release 1 (10.1)
Part Number B10759-01
BFILENAME returns a
BFILE locator that is associated with a physical LOB binary file on the server file system.
directory' is a database object that serves as an alias for a full path name on the server file system where the files are actually located.
filename' is the name of the file in the server file system.
You must create the directory object and associate a
BFILE value with a physical file before you can use them as arguments to
BFILENAME in a SQL or PL/SQL statement,
DBMS_LOB package, or OCI operation.
You can use this function in two ways:
In a DML statement to initialize a
In a programmatic interface to access
BFILE data by assigning a value to the
The directory argument is case sensitive. That is, you must ensure that you specify the directory object name exactly as it exists in the data dictionary. For example, if an
"Admin" directory object was created using mixed case and a quoted identifier in the
DIRECTORY statement, then when using the
BFILENAME function you must refer to the directory object as
'Admin'. You must specify the filename argument according to the case and punctuation conventions for your operating system.
The following example inserts a row into the sample table
pm.print_media. The example uses the
BFILENAME function to identify a binary file on the server file system:
CREATE DIRECTORY media_dir AS '/demo/schema/product_media'; INSERT INTO print_media (product_id, ad_id, ad_graphic) VALUES (3000, 31001, bfilename('MEDIA_DIR', 'modem_comp_ad.gif'));