XMLRelation Example: OutputType ('parentchild') | Teradata Vantage - XMLRelation Example: OutputType ('parentchild') - Teradata Vantage

Machine Learning Engine Analytic Function Reference

Product
Teradata Vantage
Release Number
9.02
9.01
2.0
1.3
Published
February 2022
Language
English (United States)
Last Update
2022-02-10
dita:mapPath
rnn1580259159235.ditamap
dita:ditavalPath
ybt1582220416951.ditaval
dita:id
B700-4003
lifecycle
previous
Product Category
Teradata Vantageā„¢

Input

SQL Call

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

) AS dt;

Output

The output table shows the attribute, value, and parent node for each node.

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

Download a zip file of all examples and a SQL script file that creates their input tables.