8
XML Queries Presentation by Aaron Buma Development DBA

SQL: Xml Queries - XQuery, Relative and Absolute Pathing

Embed Size (px)

Citation preview

Page 1: SQL: Xml Queries - XQuery, Relative and Absolute Pathing

XML Queries

Presentation by Aaron BumaDevelopment DBA

Page 2: SQL: Xml Queries - XQuery, Relative and Absolute Pathing

Session Overview

• The XML Data Type

• Relative Element Paths

• Absolute Element Paths

• The “data” method

Page 3: SQL: Xml Queries - XQuery, Relative and Absolute Pathing

XML Data Type

• It can be used with variables:

• It can be a column type:

Page 4: SQL: Xml Queries - XQuery, Relative and Absolute Pathing

Relative Pathing

• Using [n] to choose the 1st, 2nd, or nth node

Page 5: SQL: Xml Queries - XQuery, Relative and Absolute Pathing

Absolute Pathing

• Filtering on a value, returning a set of nodes

Page 6: SQL: Xml Queries - XQuery, Relative and Absolute Pathing

“data” Method

• Wraps the XQuery path you define• Returns the element values (not attribute values)

Page 7: SQL: Xml Queries - XQuery, Relative and Absolute Pathing

DEMO

Page 8: SQL: Xml Queries - XQuery, Relative and Absolute Pathing

Questions?• The XML Data Type• Relative Element Paths• Absolute Element Paths• The “data” function

Presentation Recording, Slides and Scripts– Available at:

http://www.aaronbuma.com/category/sql-training/