How to store PDF file in BLOB column without using indirect datastore

Hi ,
I want to store a pdf file in a BLOB column.
But , it should be a direct store. I cannot usre indirect datastore.
BLOB column doesn't support indirect datastore. I get the following error.
ERROR at line 1:
ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine
ORA-20000: Oracle Text error:
DRG-10581: indirect datastores cannot be used with long or lob text columns
ORA-06512: at "CTXSYS.DRUE", line 160
ORA-06512: at "CTXSYS.TEXTINDEXMETHODS", line 365
can anyone give me any clue onhow to manage this issue?
Advertisement
Reply

Thanks This really helped.
For other readers, I am summarising what I did.
create table test
id number primary key,
docs BLOB
create or replace directory doc_loc
as 'c:\test';
CREATE OR REPLACE PROCEDURE Load_BLOB_From_File (file_name in varchar2)
AS
src_loc bfile:= bfilename('DOC_LOC',Load_BLOB_From_File.file_name);
dest_loc BLOB;
begin
insert into tkctsf15t values(1,empty_blob()) returning docs
into dest_loc;
dbms_lob.open(src_loc,DBMS_LOB.LOB_READONLY);
DBMS_LOB.OPEN(dest_loc, DBMS_LOB.LOB_READWRITE);
DBMS_LOB.LOADFROMFILE(
dest_lob => dest_loc
,src_lob => src_loc
,amount => DBMS_LOB.getLength(src_loc));
DBMS_LOB.CLOSE(dest_loc);
DBMS_LOB.CLOSE(src_loc);
COMMIT;
end;
show errors;
exec Load_BLOB_From_File('test.pdf');
exec ctx_ddl.create_preference('mylex','BASIC_LEXER');
create index testx on test(docs) indextype is ctxsys.context
parameters
('filter ctxsys.AUTO_FILTER LEXER mylex ');
select id from test where contains(docs,'patch')>0;
Thanks Roger once more