Oracle9i SQL Reference
Release 1 (9.0.1)

Part Number A90125-01
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback

Go to previous page Go to beginning of chapter Go to next page

Functions, 42 of 166


EXTRACT (XML)

Syntax

extract_xml::=


Text description of functions142a.gif follows
Text description of extract_xml

Purpose

The EXTRACT XML function is similar to the EXISTSNODE function. It applies a VARCHAR2 XPath string and returns an XMLType instance containing an XML fragment.

Example

The following example extracts the value of the /Warehouse/Dock node of the of the warehouse_spec column XML path in the sample table oe.warehouses:

SELECT warehouse_name, 
   EXTRACT(warehouse_spec, '/Warehouse/Docks').getStringVal()
   "Number of Docks"
   FROM warehouses
   WHERE warehouse_spec IS NOT NULL;

WAREHOUSE_NAME       Number of Docks
-------------------- --------------------
Southlake, Texas     <Docks>2</Docks>
San Francisco        <Docks>1</Docks>
New Jersey
Seattle, Washington  <Docks>3</Docks>

Go to previous page Go to beginning of chapter Go to next page
Oracle
Copyright © 1996-2001, Oracle Corporation.

All Rights Reserved.
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback