Infolinks

Friday 29 January 2016

large objects

create table model_profiles
(
model_id number,
model_name varchar2(20),
photo blob,
profile clob,
protfolio bfile
);

insert into model_profiles
(model_id,model_name,photo,profile ) values( 101,'rekha',empty_blob(), 'This is my profile.........' );

select * from model_profiles; --Error...

select model_id, model_name, profile
from model_profiles;

c:\userprofiles\rekha.avi

sql> create directory userdb_dir
as 'c:\userprofiles';

Note : Inorder to create the directory object the user should have the Create Any Directory privilege...

bfilename : It is a method which is used for binding the file present in the OS level to the database...

update model_profiles
set protfolio = bfilename( userdb_dir, 'rekha.avi' )
where model_id = 101;

No comments:

Post a Comment