Top Banner
XML Queries Presentation by Aaron Buma Development DBA
8

SQL: Xml Queries - XQuery, Relative and Absolute Pathing

Jan 20, 2017

Download

Software

Aaron Buma
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
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/