Using an anonymous PL/SQL script like the following one. : XMLTYPE « PL SQL Data Types « Oracle PL/SQL Tutorial






SQL>
SQL>
SQL> CREATE TABLE testxml (id NUMBER(3), dt SYS.XMLTYPE);

Table created.

SQL>
SQL>
SQL> DECLARE
  2      x VARCHAR2(1000);
  3  BEGIN
  4
  5  INSERT INTO testxml VALUES (222,
  6  sys.xmltype.createxml(
  7  '<?xml version="1.0"?>
  8  <customer>
  9      <name>T J</name>
 10      <title>Plumber</title>
 11  </customer>'));
 12  end;
 13  /

PL/SQL procedure successfully completed.

SQL>
SQL>
SQL> SELECT *
  2  FROM testxml
  3  /

ID      DT
-----------------------------------------------------------------------------------------
222     <?xml version="1.0"?><customer><name>T J</name><title>Plumber</title></customer>


SQL>
SQL> drop table testxml;

Table dropped.








21.32.XMLTYPE
21.32.1.SYS.XMLTYPE type column
21.32.2.Using an anonymous PL/SQL script like the following one.