XMLPI scalar function
The XMLPI function returns an XML value with a single processing instruction node.
The schema is SYSIBM.
- NAME pi-name
- Specifies the name of a processing instruction. The name is an SQL identifier that must be in the form of an XML NCName. The name must not contain "xml" in any case combination.
- string-expression
- An expression that returns a value of a built-in character or
graphic string that is not a LOB and is not bit data The resulting
string will be converted to UTF-8 and parsed to check for conformance
to the content of XML processing instruction as specified by the following
rules:
- The string must not contain the substring '?>' as this terminates a processing instruction.
- Each character can be any Unicode character, excluding the surrogate blocks, X'FFFE', and X'FFFF'.
The result of the function is an XML value. The result can be null; if the string-expression argument is null, the result is the null value.
Example: Generate
an XML processing instruction node:
SELECT XMLPI(NAME "Instruction", 'Push the red button')
FROM SYSIBM.SYSDUMMY1;
The result looks similar
to the following results:
<?Instruction Push the red button?>