1 Reply Latest reply: Jan 24, 2011 8:32 AM by Yann39 RSS

    BLOB to ORDImage ORA-06510

    Yann39
      Hi,

      I'm building an Oracle APEX application and I need to show images stored as ORDImage.

      Images are stored locally and I don't have any access to the filesystem on the server.
      So I tried to upload an image in the APEX wwv_flow_files table (stored as BLOB) using Shared Components > Images > Create.

      Then I tried to convert the BLOB to ORDImage as follow :
      declare
           obj ordsys.ordimage;
      begin
           update photos p set p.phot_source = ordsys.ordimage.init() where p.phot_id = 1126;
        update photos p set p.phot_source.source.localdata = (select t.blob_content from wwv_flow_files t where t.filename = 'image_test.jpg') where p.phot_id = 1126;
        select phot_source into obj from photos where phot_id = 1126 for update;
           obj.setproperties();
           obj.setupdatetime(sysdate);
           update photos set phot_source = obj where phot_id = 1126;
      end;
      But I get the following error :
      ORA-06510: PL/SQL: unhandled user-defined exception
      ORA-06512: at "ORDSYS.ORDIMG_PKG", line 814
      ORA-06512: at "ORDSYS.ORDIMAGE", line 89
      ORA-06512: at line 7
      06510. 00000 -  "PL/SQL: unhandled user-defined exception"
      *Cause:    A user-defined exception was raised by PL/SQL code, but
                 not handled.
      *Action:   Fix the problem causing the exception or write an exception
                 handler for this condition. Or you may need to contact your
                 application administrator or DBA.
      What does it mean ?
      setProperties() seems to be the problem.

      Thanks.

      Yann.