Database Reference
In-Depth Information
Figure 17.6
Aggregating into a
Single Parent Tag.
The next example will not cause an error because the two columns are
concatenated into a single element tag. However, in this case the result
probably is not particularly useful because two distinctly different types of
data are returned as single items.
SELECT XMLELEMENT( "Artist"
, XMLAGG ( XMLELEMENT ("Artist", A.NAME ||' '|| A.CITY))
).GETSTRINGVAL() FROM ARTIST A;
The result of the next script is shown in Figure 17.7 and uses the XML-
COLATTVAL function. Figure 17.7 provides explanation.
The next example uses the XMLFOREST function to effectively create
multiple XML element tags at once. The result is shown in Figure 17.8 and
is identical to the result shown in Figure 17.4.
SELECT XMLELEMENT("Artist"
, XMLFOREST (A.NAME AS "Name", A.CITY AS "City"
, A.COUNTRY AS "Country")).GETSTRINGVAL()
FROM ARTIST A;
Search WWH ::




Custom Search