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






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.








33.7.extract
33.7.1.extract(doc, '/message/greeting/text()')
33.7.2.Use extract function and xpath function to retrieve xml element data
33.7.3.Use extract function to get xmltype data