Skip to Main Content

ORDS, SODA & JSON in the Database

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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Using a "Media Resource" to return BLOB in ORDS - What if the row doesn't exist?

Adam vonNiedaJul 8 2021 — edited Jul 8 2021

Is there a way to handle this, and instead send a BLOB that contains a "Not found" message? Otherwise we get a HTTP 404.
Here's my simple media resource query for the GET
Select mime_type as mimetype, report_blob from schema.reports where report_name = :filename
If the row is not found, I would want the report_blob to contain the row with the "Not Found" BLOB.
As in: Select report_blob into v_missing_pdf from schema.reports where report_name = 'ReportNotFound.pdf';
Edit: ORDS 3.0.9 - Database 12.2 - APEX 5.1.1
Thanks!

Comments

Post Details

Added on Jul 8 2021
1 comment
485 views