XMLCOMMENT scalar function
The XMLCOMMENT function returns an XML value with a single XQuery comment node with the input argument as the content.
The schema is SYSIBM. The function name cannot be specified as a qualified name.
-
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:
where((Char - '-') | ('-' (Char - '-')))*
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.