IsParent() function
The IsParent( ) function lets you determine if a specific node is a parent of another. This function is the opposite of IsChild().
Returns: Boolean
Syntax
IsParent(node1, node2)
- node1
- The node that you want to determine whether it is a parent of node2.
- node2
- The descendant node for which you want to find a parent.
Example
CREATE TABLE nodetab1 (col1 node);
INSERT INTO nodetab1 VALUES ('1.0');
INSERT INTO nodetab1 VALUES ('1.1');
INSERT INTO nodetab1 VALUES ('1.1.1');
SELECT n1.col1, n2.col1, IsParent (n1.col1, n2.col1)
FROM nodetab1 n1, nodetab1 n2;
col1 1.0
col1 1.1
(expression) t
col1 1.1
col1 1.1.1
(expression) t
col1 1.0
col1 1.1.1
(expression) f