March 2012
Intermediate to advanced
442 pages
9h 31m
English
The hierarchical query is a new type of SQL statement in DB2 9.7, which enables the retrieval of the hierarchical data. One can enable this feature by setting the DB2_COMPATIBILITY_VECTOR registry variable to ORA.
We can build the hierarchical queries by using the CONNECT BY clause, pseudo columns such as LEVEL, unary operators such as CONNECT_BY_ROOT and PRIOR, and using a new scalar function, SYS_CONNECT_BY_PATH.
We will run though CONNECT BY, LEVEL, CONNECT_BY_ROOT, and PRIOR to see how easy it is to get the hierarchical data in DB 9.7
If a database table contains hierarchical data, then we can use hierarchical queries to extract the data in a hierarchical order. ...
Read now
Unlock full access