Hi All,

I want to load PDF files into the database and view the content of the lobs column.  Below is what I did step by step.  Anyone please point out what did I do wrong in my procedure.  I am still unable to view the content of the Lobs column.  I need you all for your help. 

Please note that I already stored the PDF file (‘6117cdsapx.pdf’) on my Oracle server site at /Disk05/test

CREATE TABLE MY_BOOK_TEXT  (

FILE_DESC VARCHAR2 (200),

BOOK_FILE BFILE);

 

CREATE DIRECTORY TEST AS ‘/Disk05/test’;

 

DECLARE

pdf   BFILE;

BEGIN

            pdf  := BFILENAME  (‘TEST’, ‘6117cdsapx.pdf’);

END; 

/

INSERT INTO MY_BOOK_TEXT (FILE_DESC, BOOK_FILE )

VALUES (‘IBM Microprocessor’, BFILENAME(‘TEST’, ‘6117cdsapx.pdf’);

 This procedure has been executed on the server site.  When executing the procedure, it got a warning message: Procedure created with compilation errors.

CREATE OR REPLACE PROCEDURE displayLOB_proc IS
Lob_loc  BLOB;
Buffer   RAW(1024);
Amount   BINARY_INTEGER := 1024;
Position INTEGER := 1;
BEGIN
   /* Select the LOB: */
   SELECT m.Map_obj.Drawing INTO Lob_loc
   FROM Multimedia_tab m WHERE m.Clip_ID = 1;
   /* Opening the LOB is optional: */
   DBMS_LOB.OPEN (Lob_loc, DBMS_LOB.LOB_READONLY);
   LOOP
      DBMS_LOB.READ (Lob_loc, Amount, Position, Buffer);
      /* Display the buffer contents: */
      DBMS_OUTPUT.PUT_LINE(utl_raw.cast_to_varchar2(Buffer));
      Position := Position + Amount;
   END LO! OP;
   /* Closing the LOB is mandatory if you have opened it: */
   DBMS_LOB.CLOSE (Lob_loc);
   EXCEPTION
      WHEN NO_DATA_FOUND THEN
         DBMS_OUTPUT.PUT_LINE('End of data');
End;
/

Thank you all for your help in advance

Lenka



Yahoo! - We Remember
9-11: A tribute to the more than 3,000 lives lost

Reply via email to