XMLUPDATE()

Scalar. Replaces sections of an XML value matching a given XPATH string with another XML value.

Syntax

XMLUPDATE( value, update, xpath )
Parameters

value

The value to modify.

update

The replacement.

xpath

The XPATH string. Element trees in value matching this string are replaced with update.

Data Types

Return

value

update

xpath

XML

XML

XML

String

Usage

Sybase CEP Engine locates the element nodes in value that match xpath. If Sybase CEP Engine locates any non-element nodes, it logs a warning and ignores the nodes. Sybase CEP Engine replaces each matched element tree with update. Sybase CEP Engine performs the replacement in document order, so if both a tree and an ancestor of the tree match, Sybase CEP Engine only replaces the ancestor.

See Also

Example

The following example shows changing the shipping METHOD nodes to "air":

INSERT INTO OutStream
SELECT XMLUPDATE (O.orderVal,
   XMLPARSE ('<METHOD>air</METHOD>'),
   '//METHOD')
FROM O;