Nonstop Database, HiRDB Version 9 SQL Reference
![[Contents]](FIGURE/CONTENT.GIF)
![[Index]](FIGURE/INDEX.GIF)
![[Back]](FIGURE/FRONT.GIF)
1.14.2 XML constructor function
(1) Function
Generates an XML type value.
(2) Format
XML ( value-expression [AS data-type] )
|
- The following can be specified as the value expression:
- SQL variable or SQL parameter
- Embedded variable or ? parameter
- For an XML document, use the XML conversion command or XML conversion library, and specify the resulting ESIS-B format output data type as BINARY.
- If the value expression is an embedded variable or a ? parameter, the data type of the value expression must be specified with AS data-type. If AS data-type is specified, no value is permitted other than an embedded variable or a ? parameter.
- The data type of the result is the XML type.
- If the value expression is the null value, the result is also the null value.
- The XML constructor function can appear by itself in the following places:
- The insertion value of an INSERT statement
- The update value of an UPDATE statement
(4) Example
The XML document stored in the embedded variable :bookinfo is inserted into BOOK_MANAGEMENT_TABLE.
INSERT INTO BOOK_MANAGEMENT_TABLE
VALUES (310494321, XML(:bookinfo AS BINARY(102400)))
All Rights Reserved. Copyright (C) 2011, Hitachi, Ltd.