extract(doc, '/message/greeting/text()') : xpath « XML « Oracle PL / SQL






extract(doc, '/message/greeting/text()')

   

SQL> CREATE TABLE myTable(
  2      id  NUMBER PRIMARY KEY
  3      ,doc XMLType NOT NULL
  4  )
  5  XMLTYPE doc STORE AS CLOB
  6  /

Table created.

SQL>
SQL> -- Extract with text() operator returns scalar text value:
SQL> select extract(doc, '/message/greeting/text()')
  2  from myTable;

no rows selected

SQL>
SQL> drop table myTable;

Table dropped.

   
    
    
  








Related examples in the same category

1.Use extract function and xpath function to retrieve xml element data
2.Use extract function to get xmltype data
3.XPath text() function
4.Oracle support XPath predicate expressions
5.Use the EXTRACT function and the following XPath:/emps/emp/interests/interest/
6.Extract returns a COLLECTION of values (a repeating node)
7.Find rows that contain the ROWSET/ROW node