insert and read a BLOB column
Neo-bSep 8 2010 — edited Sep 9 2010Hello 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,