IsChild() function
The IsChild( ) function determines whether a node is a child of another node. This is the opposite of IsParent().
Returns: Boolean
Syntax
IsChild(node1, node2)
- node1
- The node that you want to determine whether it is a child of node2.
- node2
- The parent node for which you want to find a child.
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, IsChild (n1.col1, n2.col1)
FROM nodetab1 n1, nodetab1 n2;
col1 1.1
col1 1.0
(expression) t
col1 1.1.1
col1 1.0
(expression) f
col1 1.0
col1 1.1
(expression) f
col1 1.1
col1 1.1
(expression) f
col1 1.1.1
col1 1.1
(expression) t
col1 1.0
col1 1.1.1
(expression) f