You can use the JSON formatting 'trick' in SQL Developer.

Full scenario:
CREATE TABLE JSON_SO (
"1" INTEGER,
"2" INTEGER,
"3" INTEGER,
"4" INTEGER,
"5" INTEGER,
"6" INTEGER
);
INSERT INTO JSON_SO VALUES (
40,
20,
22,
10,
0,
0
);
select /*json*/ * from json_so;
And the output when executing with F5 (Execute as Script):
{
"results":[
{
"columns":[
{
"name":"1",
"type":"NUMBER"
},
{
"name":"2",
"type":"NUMBER"
},
{
"name":"3",
"type":"NUMBER"
},
{
"name":"4",
"type":"NUMBER"
},
{
"name":"5",
"type":"NUMBER"
},
{
"name":"6",
"type":"NUMBER"
}
],
"items":[
{
"1":40,
"2":20,
"3":22,
"4":10,
"5":0,
"6":0
}
]
}
]
}
Note that the JSON output happens client-side via SQL Developer (this also works in SQLcl) and I formatted the JSON output for display here using https://jsonformatter.curiousconcept.com/
This will work with any version of Oracle Database that SQL Developer supports, while the JSON_OBJECT() function was introduced in Oracle Database 12cR2 - if you want to have the DB format the result set to JSON for you.