Background
I need to fetch a few thousands rows from Oracle and convert them to JSON for use in SlickGrid. Currently I am fetching the rows in PHP,
To add to the answer in oracle 12.2 , you can create json as you want like this .
SELECT JSON_ARRAY( JSON_OBJECT ( KEY 'number' VALUE s.number, KEY 'name' VALUE s.sname, KEY 'location' VALUE s.loc ) ) AS student_det FROM student s;