Using 19c and created a rest web service with a PLSQL source. The PLSQL source returns a three level hierarchy JSON response based on user inputs start date and end date. At times the JSON body is very large and we want to use pagination for that.
I tried introducing the OFFSET and LIMIT in the json generation code. Snippet below

However putting limit and offset before generating the JSON and shown in comment Line 3 gives me a compile error and putting it in after the where clause in line 10 seems to compile but I still get the entire payload.
The REST definition is somewhat like this from the module section.

See below screenshot, Just need to make pagination work, please advise if I am missing something.
