This content has been marked as final.
Show 2 replies
-
1. Re: Does a virtual procedure accept Json in input Parameter?
rareddy May 9, 2018 3:19 PM (in response to sahithi.r)Sahithi,
Sure you can pass the JSON to your Virtual Procedure. You can either pass this as "string" or clob. In the procedure, you can use JSONPARSE function to parse the content, then use JSONTOXML function to convert the content to XML, then use can extract the data using the XPATHVALUE Function. For example:
select XPATHVALUE(JSONTOXML('person', jsonParse('{"Customer":{"CustomerId":88, "CustomerName":"Wellington Importadora"}}', true)), '/person/Customer/CustomerId')
should return 88. In the procedure, you would do
jsonTxt = .. xml xmlValue = JSONTOXML('root', JSONPARSE(jsonText)); value = XPATHVALUE(xmlValue, 'your-xpath-expr')
HTH
Ramesh..
-
2. Re: Does a virtual procedure accept Json in input Parameter?
sahithi.r May 14, 2018 5:13 AM (in response to rareddy)Thank you for the clear explanation.
Its working.
Regards,
Sahithi.