XMLINSERT()

Scalar. Inserts one XML value into another XML value.

Syntax

XMLINSERT( value , insert, { FIRST|LAST|AFTER|BEFORE } xpath])
Parameters

value

The original XML value.

insert

The XML value to insert.

xpath

An XPATH expression. insert is inserted into value based on the location of a match for this expression.

Data Types

Return

value

insert

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. For each matched element tree, Sybase CEP Engine inserts the specified XML value as follows:

See Also

Example

The following example shows adding a tracking number to an order after the METHOD nodes:

INSERT INTO OutStream
SELECT XMLINSERT (O.orderVal,
   XMLPARSE ('<TRACKINGNO>T060023456</TRACKINGNO>'),
   AFTER '//METHOD')
FROM O;