Create a BFILE locator : BFILE « Large Objects « Oracle PL/SQL Tutorial






SQL>
SQL> CREATE TABLE facebook (
  2     name VARCHAR2(80),
  3     photo BLOB,
  4     directions CLOB,
  5     description NCLOB,
  6     web_page BFILE);

Table created.

SQL>
SQL> CREATE DIRECTORY bfile_data AS 'c:\xxx';

Directory created.

SQL>
SQL>
SQL> DECLARE
  2     web_page BFILE;
  3  BEGIN
  4     DELETE FROM facebook WHERE name='Tannery Falls';
  5
  6     web_page := BFILENAME('BFILE_DATA','Tannery Falls.htm');
  7
  8     INSERT INTO facebook (name, web_page) VALUES ('Tannery Falls',web_page);
  9  END;
 10  /

PL/SQL procedure successfully completed.

SQL>
SQL>
SQL> drop table facebook;

Table dropped.

SQL> drop directory bfile_data;

Directory dropped.

SQL>








34.2.BFILE
34.2.1.Creating Tables Containing BFILE Objects
34.2.2.Populating a BFILE Column with a Pointer to a File
34.2.3.Populating BFILE
34.2.4.BFILE type column
34.2.5.BFILE value and BFILENAME function
34.2.6.BFILE column and directory
34.2.7.Create a BFILE locator
34.2.8.Retrieve the LOB locater
34.2.9.Use a BFILE to load a LOB column