-- Save our new locator in the waterfalls table INSERT INTO waterfalls (falls_name, falls_web_page) VALUES ('Tannery Falls',web_page);
A BFILE locator is simply a combination of directory alias and filename. The actual file and directory don’t even need to exist. That is, the database allows you to create directory aliases for directories that do not yet exist, and BFILENAME allows you to create BFILE locators for files that do not yet exist. There are times when it’s convenient to do these things.
amount BINARY_INTEGER := 60;
offset INTEGER := 1;
-- Retrieve the LOB locator for the web page SELECT falls_web_page
WHERE falls_name='Tannery Falls';
-- Open the locator, read 60 bytes, and close the locator DBMS_LOB.OPEN(web_page);
DBMS_LOB.READ(web_page, amount, offset, html);
|Working with LOBs|||||433|
The output from this code will appear as follows:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
Loads CLOBs from BFILEs. Takes care of any needed character set translation.
Loads BLOBs from BFILEs. Does the same thing as DBMS_LOB.LOADFROM‐FILE, but with an interface that is consistent with that of LOADCLOBFROMFILE.