Sybase IQ 12.6 includes a broad range of support for XML, including storing XML documents, exporting relational data as XML, importing XML, and returning XML from queries on relational data.
Currently, all of these new XML features are processed by Adaptive Server Anywhere when they occur in a predicate of an IQ query, so CIS functional compensation performance considerations apply.
FOR XML clause The SELECT statement supports a FOR XML clause with three modes, RAW, AUTO, and EXPLICIT, that allow you to obtain query results as an XML document. Each mode allows you a different level of control over the format of the XML that is generated. For more information, see Adaptive Server Anywhere SQL Reference.
FOR_XML_NULL_TREATMENT option You can use the FOR_XML_NULL_TREATMENT option to control how NULL values are returned by a query that includes the FOR XML clause. For more information, see Adaptive Server Anywhere Database Administration Guide.
OPENXML function This function generates a result set from an XML document. For more information, see Adaptive Server Anywhere SQL Reference.
SQL/XML support SQL/XML is a draft standard that describes the ways SQL can be used in conjunction with XML. As part of its SQL/XML support, Sybase IQ includes an XML data type that can be used to store XML documents in the database.
For more information, see Adaptive Server Anywhere SQL Reference.
Sybase IQ also supports the following SQL/XML functions that provide an alternative method to the FOR XML clause for generating XML documents from your relational data:
XMLAGG function This aggregate function generates a forest of XML elements from a collection of XML elements.
XMLCONCAT function This function generates a forest of XML elements by concatenating together the XML values that are passed in to it.
XMLELEMENT function This function generates an XML element for which you can optionally specify element content, attributes, and attribute content.
XMLFOREST function This function generates a forest of XML elements.
XMLGEN function This function generates an XML value based on an XQuery Constructor.
For more information on all of these functions, see Adaptive Server Anywhere SQL Reference.
XML export using the OUTPUT statement You can export query results as XML format. The output has an embedded DTD. Binary values are encoded in CDATA blocks with the binary data rendered as two-hexadecimal-digit strings.
For more information, see OUTPUT statement [DBISQL] on page 533 in Sybase IQ Reference Manual.