Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Resize image in blob using ords getting ORA-00932

rambo81Jan 21 2016 — edited Jan 22 2016

Hi

I have set a trigger on my table with the aim of when users upload an image as a blob abd the trigger will resize the image using ords and save it back into the blob

However I am getting the following errors

ORA-00932

inconsistent datatypes: expected UDT glot BLOB

inconsistent datatypes: expected BLOB got ORDSYS.ORDIMAGE

Any ideas if this is even possible, changing the dimensions of the image and saving this smaller file back into the BLOB.  The reason being is if a user uploads a picture from a camera and is 5000 x 5000 pixels  6MB I really want his to be 300x400 pixels for when it is shown in the application application and via the website (which is not apex)

CREATE OR REPLACE TRIGGER "SCHEMA"."MYTABLE"

  BEFORE INSERT OR UPDATE ON "SCHEMA".MYTABLE

  FOR EACH ROW

 

    DECLARE

  obj ORDSYS.ORDImage;

  BEGIN

SELECT imagedata INTO obj FROM MYTABLE WHERE carerID = :NEW.carerID;

  obj.process('maxScale=300,400');

  UPDATE MYTABLE SET imagedata = obj WHERE carerID = :NEW.carerID;

END;

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 19 2016
Added on Jan 21 2016
4 comments
1,389 views