Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> RE: Using SQL to load images into Oracle
Hi,
examine below example. May be it helps.
Using SQL*Loader to Load Rich Data
SQL*Loader can load whole files into internal LOBs. For example, let's add
one
column called CULINARY_REVIEW to the recipes table.
ALTER TABLE recipes
ADD (culinary_review BLOB DEFAULT EMPTY_BLOB());
The CULINARY_REVIEW column will hold Adobe Acrobat PDF files that contain
the
most recent review of the recipe. You can bulk load existing reviews into
the
database with SQL*Loader. In this example, a file named recipes.dat,
containing data targeted for insertion into the recipes table, will also
hold
the location of each recipe's review.
1,CB's Bean and Rice Soup,/u12/oracle/admin/dev/dishimages/1.pdf, 2,MC's tofu and rice surprise,/u12/oracle/admin/dev/dishimages/2.pdf, 3,Spanish Rice and Vegetable Stew,/u12/oracle/admin/dev/dishimages/3.pdf,
When loading the data, you use a SQL*Loader control file similar to this example:
LOAD DATA
INFILE 'recipes.dat'
APPEND INTO TABLE recipes
FIELDS TERMINATED BY ','
(id, name, external_filename FILLER,
culinary_review LOBFILE(external_filename)
TERMINATED BY EOF
)
Roman Mirzaitov
Brainbench MVP for Oracle Administration
www.brainbench.com
Received on Tue Apr 24 2001 - 05:52:18 CDT
![]() |
![]() |