create table tab as
select level col1, 'value '||level col2 from dual connect by level <= 2
Table created.
select json_arrayagg (
json_object (*) returning clob
) as json_doc
from tab
JSON_DOC |
---|
[{"COL1":1,"COL2":"value 1"},{"COL1":2,"COL2":"value 2"}] |