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!

Reading Excel in Blob

HeshApr 25 2012 — edited Apr 25 2012
I am searching for code that can read a spreadsheet sotred in a BLOB column, I got this from following thread but not able to get the last part , can any one help me understanding this?

10296675

SQL> create table t
(
   a    int primary key,
   bl   blob
)
/ 
Table created.
 
SQL> declare
   bl            blob;
   bf            bfile;
   dest_offset   integer := 1;
   src_offset    integer := 1;
begin
   dbms_lob.createtemporary (bl, true);
   bf := bfilename ('TEMP', 'test.xls');
   dbms_lob.open (bf, dbms_lob.lob_readonly);
   dbms_lob.loadblobfromfile (bl, bf, dbms_lob.getlength (bf), dest_offset, src_offset);
   dbms_lob.close (bf);
 
   insert into t values (1, bl);
 
   dbms_lob.freetemporary (bl);
end;
/ 
PL/SQL procedure successfully completed.
 
SQL> create index t_idx on t (bl) indextype is ctxsys.context
   parameters ( 'filter ctxsys.auto_filter' )
/ 
Index created.
 
SQL> declare
   mklob   clob;
begin
   ctx_doc.filter ('t_idx', '1', mklob, true);
   dbms_output.put_line (substr (mklob, 1, 500));
   dbms_lob.freetemporary (mklob);
end;
/ 
 
Tabelle1 
 
 
 
    A 
 
 
 
 1  This is from my excel file 
PL/SQL procedure successfully completed.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 23 2012
Added on Apr 25 2012
8 comments
6,766 views