Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Report Query and Document Generator

Darko Tiodorovic-OracleJun 23 2025 — edited Jun 23 2025

hi,
I'm stuck when creating json for publishing data that will be used by Document Generator to create pdf reports. below is a dummy query and the result I get, and also the result I want to get I'm sure there is a small mistake somewhere, but I can't find it thanks for the suggestion!

this is query:

 SELECT JSON_ARRAY (     
    JSON_OBJECT(
		'name' 	VALUE 'import'
	,	'desc' 	VALUE 'description, this brown fox...'
	,	'details' VALUE 
		JSON_OBJECT(		'color' 	VALUE 'start' , 'shape' 	VALUE 'square' )
    
    )
    ,
        JSON_OBJECT(
		'name' 	VALUE 'import'
	,	'desc' 	VALUE 'description, this brown fox...'
	,	'details' VALUE 
		JSON_OBJECT(		'color' 	VALUE 'start' , 'shape' 	VALUE 'square' )
    
    )
    )activity
  FROM DUAL;

result that I get:
(instead of json array and strings, I get all data in one string)

{
   "activity":"[{\"name\":\"import\",\"desc\":\"description, this brown fox...\",\"details\":{\"color\":\"start\",\"sha[e\":\"square\"}},{\"name\":\"import\",\"desc\":\"description, this brown fox...\",\"details\":{\"color\":\"start\",\"sha[e\":\"square\"}}]"
}

and, this is what I need:

{   "activity":[
      {
         "name":"import",
         "desc":"description, this brown fox...",
         "details":{
            "color":"start",
            "shape":"square"
         }
      },
      {
         "name":"import",
         "desc":"description, this brown fox...",
         "details":{
            "color":"start",
            "shape":"square"
         }
      }
   ]
}

thnx !!!

Comments
Post Details
Added on Jun 23 2025
2 comments
117 views