Quick Search:
CODE
Oracle PL/SQL Code Library
JOBS
Find Or Post Oracle Jobs
FORUM
Oracle Discussion & Chat
 The Oracle XMLFOREST Function      [Return To Index] Jump to:  
  Looking for the original pages? (formerly called "Morgan's Library") You can find them here.

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      :      Code Library      :      Sponsors      :      Privacy      :      Terms of Use      :      Contact Us 166 users online    © 2009 psoug.org
PSOUG LOGIN
Username: 
Password: 
Forgot your password?