Skip Headers
Oracle® Database SQL Reference
10g Release 2 (10.2)

Part Number B14200-02
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
PDF · Mobi · ePub

APPENDCHILDXML

Syntax

Description of appendChildXML.gif follows
Description of the illustration appendChildXML.gif

Purpose

APPENDCHILDXML appends a user-supplied value onto the target XML as the child of the node indicated by an XPath expression.

See Also:

Oracle XML DB Developer's Guide for more information about this function

Examples

The following example adds an /Owner node to the /Warehouse/Building node of warehouse_spec in the oe.warehouses table if the value of the /Building node is "Rented":

UPDATE warehouses SET warehouse_spec =
   APPENDCHILDXML(warehouse_spec,
   'Warehouse/Building',
   XMLType('<Owner>Grandco</Owner>'))
   WHERE EXTRACTVALUE(warehouse_spec, '/Warehouse/Building') = 'Rented';
 
SELECT warehouse_id, warehouse_name,
   EXTRACTVALUE(warehouse_spec, '/Warehouse/Building/Owner') "Prop.Owner"
   FROM warehouses
   WHERE EXISTSNODE(warehouse_spec, '/Warehouse/Building/Owner') = 1;

WAREHOUSE_ID WAREHOUSE_NAME  Prop.Owner
------------ --------------- ----------
           2 San Francisco   Grandco
           3 New Jersey      Grandco