I need a xml to create a view. Having table with xml data : tbl1 (xml datas)
I want to make a view on it so that the data will be in relational form. Structure of the xml is the folowing:
<persons>
<person>
<name>BLA1</name>
<parameters>
<param>
<key>KKK1</key>
<value>VVV1</value>
</param>
<param>
<key>KKK2</key>
<value>VVV2</value>
</param>
</parameters>
</person>
<person>
<name>BLA2</name>
<parameters>
<param>
<key>KKK21</key>
<value>VVV21</value>
</param>
<param>
<key>KKK22</key>
<value>VVV22</value>
</param>
<param>
<key>KKK23</key>
<value>VVV23</value>
</param>
</parameters>
</person>
</persons>
and the desired model in new table would be: (NAME, PARAMS) where PARAMS should be in the form of key=value;key=value;
i.e sample row would be : 'BLA1' 'KKK1=VVV1;KKK2=VVV2;'
There is probably a way to do the list aggregation in xquery, but I'm no expert in that, and this is as far as I can get
returns
I'm not sure how to merge the PARAMS and VALUES into a single column in xquery