Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Json_object in Oracle returns ORA-00907: missing right parenthesis

Tags:

json

oracle

I am trying to convert Oracle table data into JSON files. I have three databases and the below code gives output as JSON file in one DB but the other two databases throw ORA-00907: missing right parenthesis error.

Syntactically it is correct, as it gave output in one DB. Don't understand what is going wrong. This is in Oracle DB, How do I find out which version of Oracle is installed in those DB's and if they are 12.2 and above, Is there a way to fix this issue? All I want is to convert the output of a select statement to a json file. Thanks in advance

code:

SELECT JSON_OBJECT ( 'empid' value eid , 'name' value ename , 'add' value eaddr ) 
FROM abc.emp

like image 981
shri Bin Avatar asked Dec 13 '22 15:12

shri Bin


1 Answers

JSON_Object is available from Oracle version 12.2 .

Run the query Select * from v$version to check your oracle version

like image 110
Vinoth Karthick Avatar answered Dec 18 '22 10:12

Vinoth Karthick