Skip to Main Content
  • Questions
  • equivalent of DBMS_XMLGEN.GETXML to generate json

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, Spur.

Asked: March 28, 2017 - 5:47 pm UTC

Last updated: March 29, 2017 - 2:29 am UTC

Version: 12.1.0.2

Viewed 1000+ times

You Asked


We are currently generating XML data based on DBMS_XMLGEN.GETXML() to send it to client.

Instead of xml , we want to send data as JSON. Is there anything similar to DBMS_XMLGEN.GETXML to generate json ?

and Connor said...

Lots of new goodies in 12.2 for that.

Here's a link to a 12.2 hands on lab

http://www.oracle.com/technetwork/database/12cr2-json-hol-instructions-3407374.pdf

and an excellent blog post by Marco Grailke

http://www.liberidu.com/blog/2016/10/04/oracle-database-12-2-0-1-generating-json-in-the-database-using-sql-json-operators/

In 12.1, its a little more manual. My colleague Dan McGhan did a nice coverage of them

https://jsao.io/2015/07/relational-to-json-in-oracle-database/



Is this answer out of date? If it is, please let us know via a Comment

More to Explore

DBMS_XMLGEN

More on PL/SQL routine DBMS_XMLGEN here