The member function calculates the given XPATH expression xpath_expn using the XML entity of the instance as a context node. If a namespace_map parameter is given then the function adds namespace declarations from this parameter into the beginning of xpath_expn before the evaluation. The function returns 1 if the first result of XPATH evaluation is a node or 0 if there are no results or if the first result is not a node.
The function returns integer 1 or 0
This populates a table with XML data and then reports which rows contain 'empno' element inside 'emp'.
create table TEST_XMLS (I integer primary key, XMLVAL XMLType);
insert into TEST_XMLS values (1, XMLType('<emp><empno>221</empno><ename>John</ename></emp>'));
insert into TEST_XMLS values (2, XMLType('<po><pono>331</pono><poname>PO_1</poname></po>'));
insert into TEST_XMLS values (3, XMLType('<oil-rig id="14a" water="0.413"/><oil-rig id="14b" water="0.402"/>'));
select e.I, e.XMLVAL.existsNode('/emp/empno')
from TEST_XMLS as e
I callret
INTEGER NOT NULL INTEGER
_______________________________________________________________________________
1 1
2 0
3 0
3 Rows. -- 00000 msec.