Database Reference
In-Depth Information
Various Other Methods
. Beyond the scope of this topic.
Because the SQL/XML functions are the accepted standard, we shall
examine these functions in detail.
17.2.1.2.1
The SQL/XML Standard
As already stated, SQL/XML adheres to SQL/XML INCITS standards.
The following functions are available to Oracle SQL:
XMLELEMENT ( [ NAME ] identifier [, attributes ] [, expression
[ , ... ] ] )
. Creates XML tag elements such as <Name> … </Name>.
XMLATTRIBUTES ( expression [ AS alias ] [ , ... ] )
. Assigns
attribute values into tags such as <Artist Name= "...">…</Artist>.
XMLCONCAT ( XMLType object )
. This function concatenates
multiple XML element tags.
XMLAGG ( XMLType object [ ORDER BY ... ] )
. This function
creates a single column or expression from multiple rows by aggregat-
ing them into a single row and XML tag. For example:
<Artist><Name>Angie Aparo</Name><Name>Avril Lavigne</Name>
… </Artist>
XMLSEQUENCE ( XMLType object )
. Returns an array of XML-
Type objects.
XMLCOLATTVAL ( expression [ AS alias ] [ , ... ] )
. This particu-
lar function might seem a little odd at first with respect to applicabil-
ity to XML. However, it attempts to standardize for relational
structure. Every subset unit is given the tag “column,” and the origi-
nal name of the tag becomes an attribute of the column tag. For
example, <Name> Sheryl Crow</Name> becomes <column name =
"NAME">Sheryl Crow</column>.
XMLFOREST ( expression [ AS alias ] [ , ... ] )
. Functions the
same way as multiple XMLELEMENT executions, where each ele-
ment is created as a tag, containing their respective values.
XMLTRANSFORM (XMLType object, XMLType object )
. Exe-
cutes a transformation for repeating groups in an XML document,
 
Search WWH ::




Custom Search