BFILE with PL/SQL!!!!!!

From: Lani <lan.sh_at_gmx.de>
Date: Mon, 06 Mar 2000 13:00:31 +0100
Message-ID: <38C39DDF.E4F95940_at_gmx.de>


Hello,

I am trying to show Images on the Web-Browser by using ORACLE. I am using ORACLE8 not 8i.

My efforts with BLOB-s were without success. Now I am trying with BFILE, but without success, too.

I created a Table like this :

     CRETAE TABLE Image (id integer, img_f bfile);

and than I inserted Data to this Table:

     INSERT INTO Image
     VALUES (1, BFILENAME('IMG_DIR', 'photo.gif'));

Directory IMG_DIR was created bevor I used a INSERT, with :

   CREATE DIRECTORY img_dir as '/user/tests/image';

My procedure is:

---

   CREATE OR REPLACE PROCEDURE Show_Image    is

         image_var  bfile;
         dir_var    varchar2(30);
         file_var   varchar2(30);

   begin

     select img_f into image_var from image where id = 1;

     dbms_lob.filegetname(image_var, dir_var, file_var);
     htp.p('The directory is : ' || dir_var  || '<p>');
     htp.p('The filename  is : ' || file_var || '<p>');        

   end Show_Image;
   /
   show errors;
---

I access the procedure 'Show_Image' from Web-Browser like this :

     http://domain:port/owa_test/plsql_agent/Show_Image

The result is :

---

   Request Failed

   We were unable to process your request at this time.    Please try again later.
---

The directory '/user/tests/image' and the file 'photo.gif' does exist. The directory can be readed from everyone (chmod 755 image).

Do somebody know another method to handle with Images and showing them on the Web-Browser by usin ORACLE8 (not 8i)?

Sorry for my bad english!

Thanks,
Lani Received on Mon Mar 06 2000 - 13:00:31 CET

Original text of this message