| Oracle8i Application Developer's Guide - Large Objects (LOBs)  Release 2 (8.1.6) Part Number A76940-01  | 
  | 
External LOBs (BFILEs), 14 of 41
| 
See Also:
 "Use Case Model: External LOBs (BFILEs)" for all basic operations of External LOBs (BFILES).  | 
This procedure describes how to load initial data into a BFILE and the BFILE data into a table.
The BFILE datatype stores unstructured binary data in operating-system files outside the database. 
A BFILE column or attribute stores a file locator that points to a server-side external file containing the data. 
The SQL Loader assumes that the necessary DIRECTORY objects (a logical alias name for a physical directory on the server's filesystem) have already been created.
A control file field corresponding to a BFILE column consists of column name followed by the BFILE directive. 
The BFILE directive takes as arguments a DIRECTORY object name followed by a BFILE name. Both of these can be provided as string constants, or they can be dynamically sourced through some other field.
Use the following syntax references:
The following two examples illustrate the loading of BFILES. In the first example only the file name is specified dynamically. In the second example, the BFILE and the DIRECTORY object are specified dynamically.
The following examples load data into BFILES:
LOAD DATA INFILE sample9.dat INTO TABLE Multimedia_tab FIELDS TERMINATED BY ',' (Clip_ID INTEGER EXTERNAL(5), FileName FILLER CHAR(30), Photo BFILE(CONSTANT "DETECTIVE_PHOTO", FileName))
007, JamesBond.jpeg, 008, SherlockHolmes.jpeg, 009, MissMarple.jpeg,
   
LOAD DATA INFILE sample10.dat INTO TABLE Multimedia_tab replace FIELDS TERMINATED BY ',' ( Clip_ID INTEGER EXTERNAL(5), Photo BFILE (DirName, FileName), FileName FILLER CHAR(30), DirName FILLER CHAR(30) )
007,JamesBond.jpeg,DETECTIVE_PHOTO, 008,SherlockHolmes.jpeg,DETECTIVE_PHOTO, 009,MissMarple.jpeg,PHOTO_DIR,
| 
 | 
![]() Copyright © 1996-2000, Oracle Corporation. All Rights Reserved.  | 
 
  |