Creato da pastuweb.com
Share My Page
My Social Accounts
Account FaceBook Account LinkedIn Account Twitter Account Google Plus Account Git Hub

Here there is a procedure:

PROCEDURE insert_image (
      description   IN   VARCHAR2,
      src           IN   BLOB,
      metadata      IN   VARCHAR2
   )
   IS
      tmpvar      NUMBER;
      ID          wh_timage.id_image%TYPE;
      image_src   ORDIMAGE;
      xml_data    XMLTYPE;
   BEGIN
      tmpvar := 0;

      SELECT nextid
        INTO ID
        FROM DUAL;

--      image_src := ORDSYS.ORDIMAGE (src, 1);

      --      INSERT INTO wh_timage
--                  (id_image, description, image
--                  )
--           VALUES (ID, NULL, image_src
--                  );
      SELECT ORDSYS.ORDIMAGE (ORDSYS.ordsource (src, NULL, NULL, NULL, NULL,
                                                1),
                              NULL,
                              NULL,
                              NULL,
                              NULL,
                              NULL,
                              NULL,
                              NULL
                             )
        INTO image_src
        FROM DUAL;

      -- get the properties to set the member attributes of the ordimage object
      image_src.setproperties ();
      xml_data := XMLTYPE (metadata);
      -- put metadata
      image_src.putmetadata (xml_data, 'xmp', 'utf-8');

      INSERT INTO wh_timage
                  (id_image, description, image
                  )
           VALUES (ID, description, image_src
                  );
   END;

Average (1 Vote)
The average rating is 5.0 stars out of 5.