This discussion is archived
2 Replies Latest reply: Nov 19, 2012 9:20 PM by Mindmap RSS

RESTful Service: Expose BLOB file inside DB as RESTful service ??

Mindmap Pro
Currently Being Moderated
Hello,

With Oracle Cloud we can expose the Data as RESTful Web Service, but how about exposing BLOB... we need to generate a link for that file which is stored in the DB.

To make it clearer:

Two Tables:
Properties (Property_ID number PK, Project varchar2(40), Property_number varchar2(20) ...)
Images  (ID number PK, Property_ID number FK, content blob, 
mimetype varchar2(200), filename varchar2 (200), filesize varchar2 (200))
And I would like to expose this query as RESTful :
Select p.property_id, p.project, p.property_number, i.content 
from properties p inner join images i on (p.property_id = i.property_id)
Usually we use: [url http://docs.oracle.com/cd/E14373_01/apirefs.32/e13369/apex_util.htm#CHDICGDA] apex_util.get_blob_file_src  , but that one should be called from a valid apex session !!!!! ( in that query "i.content" should give a link.)

How can we do it ???

Another point, since we expose the data as JSON:
Suppose I have a property with 10 images, then it does not make sense to get 10 rows fro the same property just to give different image. I think we need another level (nested level) for images !!!

I hope that my point is clear,

Thanks in advance ....
Fateh

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points