0 Replies Latest reply: Aug 19, 2013 8:03 AM by Test2 RSS

    ORA-22275: invalid LOB locator specified

    Test2

      Hello,

       

      I use Oracle 11.2.0.3. APEX 4.2.2... Listener 2.0.3 .... Glassfish server 4.0.

       

      When I run this procedure ( that is used in this tutorial )

       

      I get ORA-22275: invalid LOB locator specified.

       

      The error persists over Glass fish 3.0.2, Listener 2.0.1 and 2.0.2.

      Also, I installed this patch 16803775, but to not avail.

       

      declare 
              v_mime  VARCHAR2(48);
              v_length  NUMBER;
              v_file_name VARCHAR2(2000);
              Lob_loc  BLOB;
      BEGIN
              SELECT MIMETYPE, CONTENT, filename,DBMS_LOB.GETLENGTH(content)
                      INTO v_mime,lob_loc,v_file_name,v_length
                      FROM image
                      WHERE id = 70;
                    --
                       htp.init;
                    -- set up HTTP header
                    --
                          -- use an NVL around the mime type and 
                          -- if it is a null set it to application/octect
                          -- application/octect may launch a download window from windows
                          owa_util.mime_header( nvl(v_mime,'application/octet'), FALSE );
      
                      -- set the size so the browser knows how much to download
                      htp.p('Content-length: ' || v_length);
                      -- the filename will be used by the browser if the users does a save as
                      htp.p('Content-Disposition:  attachment; filename="'||replace(replace(substr(v_file_name,instr(v_file_name,'/')+1),chr(10),null),chr(13),null)|| '"');
                      -- close the headers   
                      owa_util.http_header_close;         
                      owa_util.http_header_close;
                      -- download the BLOB
                      wpg_docload.download_file( Lob_loc );
      end  ;
      

       

      Any help pls, in getting that procedure works ?

       

      Regards,

      Fateh