In Oracle 21c, it looks like we can return a resultset as JSON text:
SELECT json_object(*)
from dual;
result:
{"DUMMY":"X"}
That works in db<>fiddle:
Question:
Is there a way to return the JSON text using pretty formatting?
{
"DUMMY":"X"
}
User1974User1974
asked Jan 2, 2022 at 17:24
1 Answer 1
As documented, you can add PRETTY
to a JSON function to prettify it
SELECT json_object(* PRETTY)
from dual;
Output
{
"DUMMY" : "X"
}
answered Jan 2, 2022 at 17:32
lang-sql