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!

How to read and parse blob pdf file data

Amit BhandariMay 21 2012 — edited May 24 2012
Hello,

I have a blob column in table where the pdf document data is placed. There is some sections in the pdf files which are common for all the pdf files and those values i need to split and insert into the another table.
I have used following procedure to find the location but it returns the pdf formated data as well with actual data -

CREATE OR REPLACE PROCEDURE PROC_PROCESS_PDFFILE
(
P_DATAFILENUM IN NUMBER
)
AS
v_CLOB CLOB;
v_pos number;
v_MegaKey varchar2(32000);
BEGIN

SELECT blob_to_clob(data_content) INTO V_CLOB
FROM datafile
WHERE datafilenum = P_DATAFILENUM;

--- Locate where the word begins
v_pos := instr(V_CLOB,'xxxxx Name:');

IF v_pos >= 1 THEN
v_MegaKey := substr(V_CLOB,v_pos,2000);
htp.p(v_MegaKey);
ELSE
htp.p('v_pos Not Found');
END IF;
END

The output is -

xxxxx Name: ) Tj
ET
Q
Q
Q
q
340.00 607.00 m
788.00 607.00 l
788.00 590.00 l
340.00 590.00 l
h
W
n
q
q
BT
/OBJ4 13.00 Tf
341.00 594.417 Td
0.00 0.00 0.00 rg
-0.36 Tc
(BHANDARI,AMIT) Tj
ET
Q
Q
Q
q
216.00 588.00 m
338.00 588.00 l
338.00 571.00 l
216.00 571.00 l
h
W
n
q
q
BT
/OBJ4 13.00 Tf
217.00 575.417 Td
0.00 0.00 0.00 rg
-0.16 Tc
**********************************
Now instead of above other data (PDF characters) i need to retrieve the following data and need to insert the another table -
for e.g. xxxxx Name: BHANDARI,AMIT

is it possible to read and split the pdf data?

Thanks
Amit Bhandari

Edited by: 935671 on 21-May-2012 07:13
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 21 2012
Added on May 21 2012
5 comments
32,698 views