existsnode and where clause : existsNode « XML « Oracle PL/SQL Tutorial






SQL> create table myTable of xmltype;

Table created.

SQL>
SQL> insert into myTable values(XMLTYPE('
  2    <customer>
  3     <name>Chris</name>
  4      <telephone>123 555-1234</telephone>
  5    </customer>'))
  6  /

1 row created.

SQL>
SQL> select * from myTable;



SYS_NC_ROWINFO$
------------------------------------------------------

  <customer>
   <name>Chris</name>
    <telephone>123 555-1234</telephone>
  </

1 row selected.

SQL>
SQL> update myTable c
  2  set value(c) = updateXML(value(c), '/customer/name/text()','new value')
  3  /

1 row updated.

SQL>
SQL>
SQL> select extractvalue(value(c),'/customer/telephone')
  2  from myTable c
  3  where existsnode(value(c),'/customer/name = "Chris"') = 1
  4  /

no rows selected

SQL>
SQL> drop table myTable;

Table dropped.

SQL>








33.6.existsNode
33.6.1.Call existsNode() function from xmltype data
33.6.2.Count(*) and existsnode()
33.6.3.Find rows that contain the ROWSET/ROW node
33.6.4.Oracle XML function ExistsNode.
33.6.5.existsnode and where clause
33.6.6.existsnode(myValue, '/ROWSET')