XMLType.CreateXML : XMLType « PL SQL Data Types « Oracle PL/SQL Tutorial






SQL>
SQL> CREATE TABLE myTable (
  2     fall_id NUMBER,
  3     fall SYS.XMLType
  4  );

Table created.

SQL>
SQL> INSERT INTO myTable VALUES (1, SYS.XMLType.CreateXML(
  2     '<?xml version="1.0"?>
  3      <fall>
  4         <name>myTable</name>
  5         <county>USA</county>
  6         <state>MI</state>
  7         <url>
  8            http://your.com
  9         </url>
 10      </fall>'));

1 row created.

SQL>
SQL> INSERT INTO myTable VALUES (2, SYS.XMLType.CreateXML(
  2     '<?xml version="1.0"?>
  3      <fall>
  4         <name>Au myTable</name>
  5         <county>USA</county>
  6         <state>MI</state>
  7         <url>
  8            http://your.com
  9         </url>
 10      </fall>'));

1 row created.

SQL>
SQL> INSERT INTO myTable VALUES (3, SYS.XMLType.CreateXML(
  2     '<?xml version="1.0"?>
  3      <fall>
  4         <name>myTable</name>
  5         <county>USA</county>
  6         <state>MI</state>
  7      </fall>'));

1 row created.

SQL>
SQL>
SQL>
SQL>
SQL> drop table myTable;

Table dropped.

SQL>








21.46.XMLType
21.46.1.XMLType.CreateXML
21.46.2.XMLType.getStringVal
21.46.3.Extract and display the URL