Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

insert and read a BLOB column

Neo-bSep 8 2010 — edited Sep 9 2010
Hello all,

i am using Oracle 10g R2,

i have a table that contains many columns, one of them is a BLOB column, i need to upload a Microsoft word document (.doc) into this BLOB column to link it to the corresponding information. i did that in the below code:

DECLARE
l_bfile BFILE;
l_blob BLOB;
BEGIN
INSERT INTO test_word_doc (blob_col )
VALUES (empty_blob())
RETURN blob_col INTO l_blob;

l_bfile := BFILENAME('SPECS_DIR', 'testBLOB.doc');
DBMS_LOB.fileopen(l_bfile, Dbms_Lob.File_Readonly);
DBMS_LOB.loadfromfile(l_blob, l_bfile, DBMS_LOB.getlength(l_bfile));
DBMS_LOB.fileclose(l_bfile);

COMMIT;
END;
+/+


now i need to be able and after a time to save this file from the BLOB document to a certain directory that any user can access it, open the document and read it.

What is the solution so i can save the document in the BLOB column to a certain directory??

Regards,
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 7 2010
Added on Sep 8 2010
4 comments
1,515 views