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!

What is the best way to return response from REST service

Hawk333Nov 2 2016 — edited Nov 6 2016

I am using ORDS to request data from the DB. I pass parameters in the header (using 'GET' method), and used 'htp.p(response)' to send back the data to the client.

Response in this case is set to be of CLOB type. Because my response data could be longer than 32K. This worked fine for a while. However, when the data grew, and exceeded the 32K limit, I started to get the error "buffer too small". Only then I realized that 'htp.p()' will print out up to 32K bytes.

My question is, what is the best way to send in response of REST request more than 32K. Is looping through the CLOB, and sending chunks using htp.p() a good approach. I tried to use it without loop (multiple htp.p()), and seems to work). But I am wondering if there is a better way to handle this.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 4 2016
Added on Nov 2 2016
2 comments
1,450 views