Return results of a sql query as JSON in oracle 12c

12cR2 (available in the Oracle Cloud) supports this natively. SQL> select JSON_ARRAY(EMPLOYEE_ID, FIRST_NAME,LAST_NAME) from HR.EMPLOYEES; JSON_ARRAY(EMPLOYEE_ID,FIRST_NAME,LAST_NAME) ——————————————————————————– [100,”Steven”,”King”] [101,”Neena”,”Kochhar”] or SQL> select JSON_OBJECT(‘ID’ is EMPLOYEE_ID , ‘FirstName’ is FIRST_NAME,’LastName’ is LAST_NAME) from HR.EMPLOYEES; JSON_OBJECT(‘ID’ISEMPLOYEE_ID,’FIRSTNAME’ISFIRST_NAME,’LASTNAME’ISLAST_NAME) —————————————————————————- {“ID”:100,”FirstName”:”Steven”,”LastName”:”King”} {“ID”:101,”FirstName”:”Neena”,”LastName”:”Kochhar”}

Oracle Joins – Comparison between conventional syntax VS ANSI Syntax

If your 200+ packages work as intended with “old fashioned” syntax, let it be. SQL will not start to perform better after migration to ANSI syntax – it’s just different syntax. All that being said, ANSI syntax is cleaner – you are not going to normal join if you forget (+) in some multi-column outer … Read more

How to install Oracle Instant Client on a Mac?

HomeBrew saved me. I did not figure out the environment path. Per referenced blog this Answer (see bottom) was originated from: (Update 10/06/2020: Step 1 is no longer necessary, just run the brew commands!) 1. Download the two files below from http://www.oracle.com/technetwork/topics/intel-macsoft-096467.html. This is necessary because of Oracle licenses. instantclient-basic-macos.x64–11.2.0.4.0.zip and instantclient-sqlplus-macos.x64–11.2.0.4.0.zip Put the files … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)