Create a table to hold the simple "Hello World" XML document : Introduction « XML « Oracle PL/SQL Tutorial






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

Table created.

SQL>
SQL>
SQL> 
SQL> DECLARE
  2      v_doc  XMLType;
  3      v_text varchar2(100);
  4  BEGIN
  5      select doc into v_doc from myTable
  6      where id = 2;
  7
  8      v_text := v_doc.extract('/message/body/text()' ).getstringval;
  9
 10      dbms_output.put_line(v_text);
 11  END;
 12  /

SQL>
SQL> drop table myTable;

Table dropped.

SQL>








33.1.Introduction
33.1.1.SQL to XML
33.1.2.Create a table to hold the simple "Hello World" XML document
33.1.3.Create table based on single data type
33.1.4.Create table myTable of xmltype
33.1.5.Use Aggregrate functions on XML data
33.1.6.Use Text() function to get text value from xml string
33.1.7.xmlagg and xmlforest
33.1.8.Without the text() operator, returns node name + text value