Quick Search:
 
 The Oracle XMLFOREST Function      [Return To Index] Jump to:  

Term: XMLFOREST

Definition:
In Oracle PL/SQL, the XMLFOREST function converts each of its arguments to XML and returns an XML fragment that is the concatenation of the converted arguments.

Example Syntax:

XMLFOREST( [value expression AS alias], [...])


If value expression is an object type or collection, then the AS clause is mandatory, and Oracle uses the specified alias as the enclosing tag.

If value expression is a scalar expression, then you can omit the AS clause. The Oracle database will use the column name as the element name.

If value expression is NULL, then no element is created for that value expression.


Example Usage:

SQL>SELECT XMLELEMENT("Name_Rec", 
XMLFOREST(e.employee_id, e.last_name, e.salary))
"Name_Rec Element"
FROM employees e WHERE employee_id = 1048;

Name_Rec Element
----------------------------------------------------------------
<Name_Rec>
<EMPLOYEE_ID>1048</EMPLOYEE_ID>
<LAST_NAME>Franklin</LAST_NAME>
<SALARY>46000</SALARY>
</Name_Rec>


Related Links:
 
   Home |    Search |    Code Library |    Sponsors |    Privacy |    Terms of Use |    Contact Us © 2003 - 2024 psoug.org