Skip to Main Content

SQL & PL/SQL

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!

htp.p and CLOBS in JSON / XML responses

Simon CollinsFeb 27 2015 — edited Feb 27 2015

Hi

We use htp.p a lot to send out JSON output through restful services (Oracle 11.2.0.4). The problem we occasionally encounter is the output is larger than the 32K limit that htp.p allows. In these cases we have procedures that loop through the CLOB and spit out the htp.p in chunks. The issues we have is that if you do this in an arbitrary way (say every 32K bytes) then the JSON can become invalid (to the receiver) as it seems that each htp.p process appends a CR/LF to the output. We have modified routines to chunk the output every time it sees a "safe" character, like '}' for example, but this is not fool proof as there are times when the gap between occurrences of this character are larger than 32K. I can't help but think there is an easier solution to all this that I'm missing. Any help appreciated

Thanks

Simon

This post has been answered by Anton Scheffer on Feb 27 2015
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 27 2015
Added on Feb 27 2015
2 comments
1,166 views