Skip Headers
Oracle® Database SQL Language Reference
11g Release 2 (11.2)

Part Number E26088-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
SQLRF06232

XMLTABLE

SQLRF52048Syntax

Description of xmltable.gif follows
Description of the illustration xmltable.gif

SQLRF52049XMLnamespaces_clause::=

Description of xml_namespaces_clause.gif follows
Description of the illustration xml_namespaces_clause.gif

SQLRF52050XMLTABLE_options::=

Description of xmltable_options.gif follows
Description of the illustration xmltable_options.gif

SQLRF52051XML_passing_clause::=

Description of xml_passing_clause.gif follows
Description of the illustration xml_passing_clause.gif

SQLRF52052XML_table_column::=

Description of xml_table_column.gif follows
Description of the illustration xml_table_column.gif

SQLRF52053Purpose

XMLTable maps the result of an XQuery evaluation into relational rows and columns. You can query the result returned by the function as a virtual relational table using SQL.

See Also:

Oracle XML DB Developer's Guide for more information on the XMLTable function, including additional examples, and on XQuery in general

SQLRF52054Examples

The following example converts the result of applying the XQuery '/Warehouse' to each value in the warehouse_spec column of the warehouses table into a virtual relational table with columns Water and Rail:

SELECT warehouse_name warehouse,
   warehouse2."Water", warehouse2."Rail"
   FROM warehouses,
   XMLTABLE('/Warehouse'
      PASSING warehouses.warehouse_spec
      COLUMNS 
         "Water" varchar2(6) PATH '/Warehouse/WaterAccess',
         "Rail" varchar2(6) PATH '/Warehouse/RailAccess') 
      warehouse2;

WAREHOUSE                           Water  Rail
----------------------------------- ------ ------
Southlake, Texas                    Y      N
San Francisco                       Y      N
New Jersey                          N      N
Seattle, Washington                 N      Y
Reader Comment

   

Comments, corrections, and suggestions are forwarded to authors every week. By submitting, you confirm you agree to the terms and conditions. Use the OTN forums for product questions. For support or consulting, file a service request through My Oracle Support.

Hide Navigation

Quick Lookup

Database Library · Master Index · Master Glossary · Book List · Data Dictionary · SQL Keywords · Initialization Parameters · Advanced Search · Error Messages

Main Categories

This Document

New and changed documents:
RSS Feed HTML RSS Feed PDF