I have a simple APEX project where the user uploads an image (ORDImage) to the database. There is a page which lists every image that's on the system, accompanied by a thumbnail of the image.I have the SQL code to create the thumbnail, but unfortunately when I call the code (using a Button Click + SQL process) I'm only able to create thumbnails for specific IDs (see code at the bottom). I know there's a simple fix but I'm gone brain dead, any help appreciated :waveHere is procedure to create thumbnail:CREATE OR REPLACE PROCEDURE create_blob_thumbnail (p_image_id IN INTEGER) IS l_orig ORDSYS.ORDImage; l_thumb ORDSYS.ORDImage; l_blob_thumb BLOB; BEGIN -- lock row SELECT image INTO l_orig FROM images WHERE image_id = p_image_id FOR UPDATE; l_thumb := ORDSYS.ORDImage.Init(); dbms_lob.createTemporary(l_thumb.source.localData, true); ORDSYS.ORDImage.processCopy(l_orig, 'maxscale=128 128', l_thumb); UPDATE images SET thumbnail = l_thumb.source.localData WHERE image_id = p_image_id; dbms_lob.freeTemporary(l_thumb.source.localData); COMMIT; END;
This is the code that calls for a specific thumbnail to be created, the number in the parenthesis is the primary key where the image is stored:BEGIN create_blob_thumbnail(1); create_blob_thumbnail(2); create_blob_thumbnail(3);END;