Oracle9i SQL Reference Release 1 (9.0.1) Part Number A90125-01 |
|
Functions, 125 of 166
sys_xmlgen::=
sys_xmlgen
The SYS_XMLGEN
function takes an expression that evaluates to a particular row and column of the database, and returns an instance of type SYS.XMLType
containing an XML document. The expr can be a scalar value, a user-defined type, or an XMLType
instance.
XMLType
instance, then the function encloses the document in an XML element whose default tag name is ROW
.
By default the elements of the XML document match the elements of expr. For example, if expr resolves to a column name, the enclosing XML element will be the same column name. If you want to format the XML document differently, specify fmt, which is an instance of the SYS.XMLGenFormatType
object.
See Also:
|
The following example retrieves the employee email ID from the sample table oe.employees
where the employee_id
value is 205, and generates an instance of an XMLType
containing an XML document with an EMAIL
element.
SELECT SYS_XMLGEN(email).getStringVal() FROM employees WHERE employee_id = 205; SYS_XMLGEN(EMAIL).GETSTRINGVAL() ------------------------------------------------------------------ <EMAIL>SHIGGENS</EMAIL>
|
Copyright © 1996-2001, Oracle Corporation. All Rights Reserved. |
|