Hi,
Mine is Oracle 12c plus ORDS 3
I have a table (my_test) with two col, one col is project_no, another is a p_definition, an Json col that will store the actual json data.
I have create a web service where I want to return the data stored in the p_definition as JSON data, I am using the sql
select JSON_QUERY(p_definition,'$') as definition from my_test to provide the web service and here is what I got, as you can see, the actual json data is returned as a col(definition)
{
- items:
[
- {
- definition: "{"BuildSequence":["ServerBuild","DBBuild"],"DataBase":[{"SID":""}],"Environment":{"DC":"XXX","Environment":"Stage"},"Project_No":"30","Servers":[{"Application":"app1.1","Hostname":"","size":"small"}]}"
- }
- {
- definition: "{"BuildSequence":["ServerBuild","DBBuild"],"DataBase":[{"SID":""}],"Environment":{"DC":"YYY","Environment":"Prod"},"Project_No":"24","Servers":[{"Application":"app1.1","Hostname":"","size":"small"}]}"
- }
]
}
What I wanted is something like this, eg, I wanted the json data return as json, not data in a col.
{
-items:[
{ "BuildSequence":[ "ServerBuild","DBBuild"],
"DataBase":[ { "SID":""}],
"Environment":{ "DC":"XXX","Environment":"Stage"},
"Project_NO":"30",
"Servers":[ { "Application":"app1.1","Hostname":"","size":"small"}]
}
{ "BuildSequence":[ "ServerBuild","DBBuild"],
"DataBase":[ { "SID":""}],
"Environment":{ "DC":"YYY","Environment":"Stage"},
"Project_NO":"30",
"Servers":[ { "Application":"app1.1","Hostname":"","size":"small"}]
}
]
}
Is this possible?
Thanks
Mike