Sybase WorkSpace supports creation of select…for xml statements when using an ASE or SQL Anywhere profile through use of an XML view in the SQL Query Editor and Visual SQL.
The select...for xml statement returns query results in XML format. When you select Return Results as XML, Sybase WorkSpace appends FOR XML to the generated select statement. The XML view also contains options specific to SQL Anywhere or ASE for controlling the results and formatting of the returned XML code.
Option | Value/description |
---|---|
Columns As |
Attributes: show columns as attributes. Elements – show columns as elements. |
Elements |
Each row is returned as an element: each result row is represented as a <row> element.
Each table is returned as an element – an element is created for each table in the select list. |
Option | Value/description |
---|---|
Columns As |
Attributes – show columns as attributes
Elements (default) – show columns as elements. |
Results Contain |
XML in one row (default) – the result set has one row containing the XML. One row per element – the result set has one row per XML element. |
Include Root | Include a root element in the results (default). |
Root Label | Specify the label for the root element (default is resultset). Disabled if Include Root is not selected. |
Include Select Statement | Include the SQL query in the root element. Disabled if Include Root is not selected. |
Row Label | Specify the name of the row element (default is row). |
Namespace | Include a URL as the xmlns attribute. |
Schema Location | Include a URL as the xsi:SchemaLocation (or xsi:noNamespaceSchemaLocation if Namespace is not specified) attribute. |
Format | Include formatting for newline and tab characters. |
Header | Include an XML header. |
Null Style |
Attribute – include null columns as empty elements with the
xsi:null=true
attribute.
Omit (default)– omit null columns from the row that contains them. Disabled if Columns As = "Attributes". |
For product-related issues, contact Sybase Technical Support at 1-800-8SYBASE. Send your feedback on this help topic directly to Sybase Technical Publications: pubs@sybase.com