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.