0

One of the tables in my DB has a BLOB column that stores images. So now I am setting up the page for this table. I have a bunch of IGs and such to process most of the data, but I set up a modal page to process the image.

The modal page gets the ID (which is the PK) into an item, and then it reads the image currently in the table into a 'Display Image' item. And I have a 'File browse...' item to upload new images.

Except I cannot get it to save.

I initially started with the display image item just having Setting Based on : BLOB column returned by SQL statement, as I couldn't get the source to work with the SQL query(Error Expected CHAR, source is BLOB), I managed to resolve this by putting automatic row processing on the page and then having the source be a column.

So now it displays well, with no errors.

But the save does nothing. I have tried saving by having the File browse reference the column and using automatic row processing, and there is just nothing. No errors pop up, but it just does nothing.

I have tried saving to APEX_APPLICATION_TEMP_FILES and then having a PLSQL DA or a PLSQL process to

SELECT blob_content 
  FROM APEX_APPLICATION_TEMP_FILES
 WHERE name = :FILE_BROWSER_ITEM

And insert this into the table, but it just pops up a 'No data found' error.

I have gone through every bit of intel my google-fu has found, but I have failed to find a solution.

So I would appreciate any insight any of you might have.

1 Answer 1

1

Since noone answered, I stepped away from it for a bit and tried again at a later date. And now I made it work finaly.

I set up automatic row fetch and automatic row processing but disabled both of them, for some reason automatic row processing must be there so that you can have the source for the display image and file browse be the column.

Then I set the browse file to load into apex_application_temp_files. and set up a process to be executed at page submit(but after the automatic row processing even though its disabled and shouldnt matter). The process executing the following code:

BEGIN
  UPDATE MY_TABLE
     SET MY_IMAGE = (SELECT blob_content
                   FROM apex_application_temp_files
                  WHERE name = :FILE_BROWSER_ITEM)
   WHERE id = :ID;
END;

And I execute the page submit through a button with the action page submit and Database action being SQL UPDATE action.

I am guessing a fair bit of the things I did and have set up dont even matter, but I dont dare remove them for fear of breaking shit. What I have described here finaly works for me, and if you stumble upon this then you can try and I hope it works for you too, and you can try removing some of the disabled stuff and see if it still works.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.