XMLRelation Example: OutputType ('fullpath') - Teradata Vantage

Machine Learning Engine Analytic Function Reference

Product
Teradata Vantage
Release Number
8.10
1.1
Published
October 2019
Language
English (United States)
Last Update
2019-12-31
dita:mapPath
ima1540829771750.ditamap
dita:ditavalPath
jsj1481748799576.ditaval
dita:id
B700-4003
lifecycle
previous
Product Category
Teradata Vantageā„¢

Input

SQL Call

This call specifies the default Output syntax element value.

SELECT * FROM XMLRelation (
  ON xmlrelation_input
  USING
  TextColumn ('xmldocument')
  DocIDColumns ('xid')
  MaxDepth (3)
  OutputType('fullpath')

) AS dt;

Output

The output table shows the ID for each node in a separate column.

 xid out_nodeid element attributes         value_col d0id d1id d2id d3id 
 --- ---------- ------- ------------------ --------- ---- ---- ---- ---- 
   1          4 Student                    Harry        1    2    3    4
   1          5 Grade                      A+           1    2    3    5
   1          3 Class   A=grad,B=undergrad              1    2    3 NULL
   1          2 Dept    name=EE                         1    2 NULL NULL
   1          1 School  name=UCLA                       1 NULL NULL NULL

Download a zip file of all examples and a SQL script file that creates their input tables from the attachment in the left sidebar.