Q

Saving files larger than 4K in Oracle 8

How can we save doc or text files that are larger than 4K in Oracle 8 or 8i through LOB? Please tell me in detail...

with example.

Here is the code to load a file. It's straight to load the file:
-- the table you want to load to

drop table blobs;
create table blobs
( id        varchar2(255),
  theBlob   blob
)
/
-- declare a directory object
create or replace directory MY_FILES as '/export/home/tkyte/public_html';

-- script to load a file, aria.gif is the file to load:
declare
    l_bfile bfile;
    l_blob  blob;
begin
    insert into blobs values ( 'MyGif', empty_blob() )
    return theBlob into l_blob;

    l_bfile := bfilename( 'MY_FILES', 'aria.gif' );
    dbms_lob.loadfromfile( l_blob, l_bfile, dbms_lob.getlength(l_bfile) );
    commit;
end;
/
dbms_lob.loadfromfile does all the loading of file; the file must exist in the directory given by the MY_FILES directory.


This was last published in June 2002

Dig Deeper on Oracle database backup and recovery

PRO+

Content

Find more PRO+ content and other member only offers, here.

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

-ADS BY GOOGLE

SearchDataManagement

SearchBusinessAnalytics

SearchSAP

SearchSQLServer

TheServerSide

SearchDataCenter

SearchContentManagement

SearchFinancialApplications

Close