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

Term: UPDATEXML

Definition:
The Oracle UPDATEXML function allows you to update XML content stored in Oracle Database. It takes an XMLType instance and an XPath-value pair as arguments and returns an XMLType instance with the updated value.

Example Syntax:

UPDATEXML(XMLType_Instance, XPath_string,
value_expression, namespace_string)


Example Usage:

SELECT warehouse_name,
EXTRACT(warehouse_spec, '/Warehouse/Docks') "Number of Docks"
FROM warehouses
WHERE warehouse_name = 'San Francisco';

UPDATE warehouses
SET warehouse_spec = UPDATEXML(warehouse_spec,
'/Warehouse/Docks/text()',4)
WHERE warehouse_name = 'San Francisco';

SELECT warehouse_name,
EXTRACT(warehouse_spec, '/Warehouse/Docks') "Number of Docks"
FROM warehouses
WHERE warehouse_name = 'San Francisco';


Related Links:
 
Home      :      Code Library      :      Sponsors      :      Privacy      :      Terms of Use      :      Contact Us 188 users online    © 2009 psoug.org
PSOUG LOGIN
Username: 
Password: 
Forgot your password?