XMLATTRIBUTES()

Scalar. Appends one or more attributes to an XML element being constructed with XMLELEMENT().

Syntax

XMLATTRIBUTES( value AS name [, ...])
Parameters

value

The value of the attribute. If Null, the function generates no attribute.

name

The unique name of the attribute. The name must obey XML naming conventions and be in-scope for XML name spaces.

Data Types

Return

value

name

XML

String

String

See Also

Example

The following example shows an attribute being inserted during the construction of an XML element:

INSERT INTO OutStream
SELECT XMLELEMENT("order",
   XMLATTRIBUTES(orders.customerName AS "custname"), 
   XMLELEMENT("orderid", orders.orderid))
FROM Orders;