I would like to achieve a query on XML Element but could not find a proper way to achieve this.
Let's consider this table:
CREATE TABLE SUBSCRIPTIONS(
SUBSCRIPTION_ID NUMBER,
PARAMETERS_XML CLOB
);
My XML looks like:
<Model>
<Parameters>
<Parameter>
<userParameter>outlets</userParameter>
<Values>
<Value>45</Value>
<Value>676</Value>
<Value>1502</Value>
...
</Values>
</Parameter>
</Parameters>
</Model>
I'm trying for each subscription to get from the XML, the parameter name, and the parameters values, using this query:
SELECT
s.SUBSCRIPTION_ID,
s.PARAMETERS_XML,
xt.*
FROM EFNTA.SUBSCRIPTIONS s,
XMLTABLE(
'/Model/Parameters/Parameter'
PASSING XMLTYPE(s.PARAMETERS_XML)
COLUMNS USER_PARAM VARCHAR2(100) PATH 'userParameter',
PARAM_VALUE VARCHAR2(1000) PATH '//*:Values',
CHECKED_LIST_EXCLUDE VARCHAR2(100) PATH '//*:CheckedListExclude'
) xt ORDER BY 1 DESC;
Issue is that when there are multiple values, the result is returned as one big concatenated chain:
Is there any easy way to separate theses values with a comma, semicolon, or whatever ? (I don't know the number of values in advance) I couln't find how to achieve this with XPath.

