|
-
Hi,
I have inserted the word doc inside the database using the code below. How you i retrive it from the database. Any suggestions!
create or replace directory MY_FILES as 'C:\Uploadfolder';
Create table emp1
Create table emp1(
EMPNO number(30),
EMPNAMe varchar2(10),
RESUME BLOB);
To check the path is set in the dba_directories:
select * from dba_directories;
***************
declare
f_lob bfile;
b_lob blob;
begin
insert into emp1(empno,empname,resume)
values ( 1001, 'BILLGATES',empty_blob() )
return resume into b_lob;
-- resume is the field name in my table which has BLOB data type
f_lob := bfilename( 'MY_FILES', 'Purchase.doc' );
dbms_lob.fileopen(f_lob, dbms_lob.file_readonly);
dbms_lob.loadfromfile
( b_lob, f_lob, dbms_lob.getlength(f_lob) );
dbms_lob.fileclose(f_lob);
commit;
end;
/
The doc is sucessfully inserted in the database .
How do i retrive the data back?
Thanks,
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|