| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: Can XQuery handle hierarchical data?
Script below models the hierarchy with an experimental db (not XQuery)
and walks the tree recursively.
// Create persons
(CREATE *person.item ~in = dir)
(CREATE *allen.cls = person)
(CREATE *smith.cls = person)
(CREATE *miller.cls = person)
(CREATE *adam.cls = person)
// Create salaries
(CREATE *salary.item ~in = dir)
(CREATE allen.salary=+2000)
(CREATE smith.salary=+1500)
(CREATE miller.salary=+1800)
(CREATE adam.salary=+1000)
// Create verbs for heirarchy
(CREATE *boss.cls = verb)
(CREATE boss.vbType = kr)
(CREATE *employee.cls = verb)
(CREATE employee.vbType = cr)
(CREATE boss.opposite = employee)
// Create hierarchy
(CREATE allen.employee = smith)
(CREATE allen.employee = miller)
(CREATE miller.employee = adam)
// Selects allen's empolyees recursively
// Selects smith, miller, adam
(SELECTR allen.employee)
Received on Thu Jan 13 2005 - 22:59:46 CST
![]() |
![]() |