I´m trying to create a json file over multiples functions inside a package in oracle sql, i can create the whole json in one single select, but it is a quite big select, so, i want to devide everything into multiple functions.
the problem is, when trying to assemble the whole json, the values that should have an array inside and mantain the json structure, are instead placed as a string.
small example:
"indicadoresOperacao": "[{"id":"11122/2024","indicadorConceitoSincronizado":"true","indicadorSincronizarConceito":"false"
this is generated here:
KEY 'indicadoresOperacao' VALUE get_json_indicadores_op_plano( id_pr),
and inside the function i have a SELECTcreating a JSON_ARRAYAGG and im returning a CLOB.
everything that i tried that isnt creating the whole thing together(wich takes more time) ends up in this same format, i think i know that the problem is me trying to associate the VALUE to a CLOB, instead of the select it self, and i dont know how to work around it to make the code easy to read and change when needed.
Ricardo Morais is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.