DB2 Version 9.7 for Linux, UNIX, and Windows

XMLCOMMENT scalar function

Read syntax diagramSkip visual syntax diagram
>>-XMLCOMMENT--(--string-expression--)-------------------------><

The schema is SYSIBM. The function name cannot be specified as a qualified name.

The XMLCOMMENT function returns an XML value with a single XQuery comment node with the input argument as the content.

string-expression
An expression whose value has a character string type: CHAR, VARCHAR or CLOB. The result of the string-expression is parsed to check for conformance to the requirements for an XML comment, as specified in the XML 1.0 rule. The result of the string-expression must conform to the following regular expression:
   ((Char - '-') | ('-' (Char - '-')))*
where Char is defined as any Unicode character excluding surrogate blocks X'FFFE' and X'FFFF'. Basically, the XML comment cannot contain two adjacent hyphens, and cannot end with a hyphen (SQLSTATE 2200S).

The data type of the result is XML. If the result of string-expression can be null, the result can be null; if the input value is null, the result is the null value.