Query xmltype column : XMLTYPE « XML « Oracle PL/SQL Tutorial






SQL> create table myTable(
  2     id number(9),
  3     myValue xmltype
  4  );

Table created.

SQL> begin
  2    dbms_xmlschema.registerSchema ('http://d.com/myType.xsd',xdbURIType('/xsd/myType.xsd').getClob(),True,True,False,True);
  3  end;
  4  /


SQL>
SQL> insert into myTable values (67, XMLTYPE('<myType xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://d.com/myType.xsd">
  2       <value1>1</value1>
  3       <value2>2</value2>
  4   </myType>'))
  5  /

1 row created.

SQL>
SQL> select * from myTable;



   emp
Number
------
MYVALUE
------------------------------------------------------
    67
<myType xmlns:xsi="http://www.w3.org/2001/XMLSchema-in
stance" xsi:noNamespaceSch

1 row selected.

SQL>
SQL> drop table myTable;

Table dropped.








33.4.XMLTYPE
33.4.1.XMLTYPE column
33.4.2.Use sys.xmltype.createxml to add XML data to table
33.4.3.Retrieve value from SYS.XMLTYPE column
33.4.4.Individual fields from the XMLTYPE'd column may be found using the EXTRACTVALUE function like this:
33.4.5.Creation of tables using XMLType data type and set the xml schema
33.4.6.Insert xml document to a XMLType column with xmltype function
33.4.7.PL/SQL ability to access text within an XML document in the database
33.4.8.Query xmltype column
33.4.9.Store an XMLType type data in clob
33.4.10.Use value function with single xmltype table
33.4.11.Use xmltype to convert xml string to xmltype data