|
A simple XML Type exercise for Oracle 9i Release 1 |
|
|---|---|---|
As of Oracle 9i release 1, you can use XMLType as a datatype in your tables. XMLType can be used to store and query XML data in the database. As a type, XMLType has member functions to access, extract, and query XML data using a class of operations known as Xpath expressions. The following listing shows the creation of a table using the XMLType datatype (text in BOLD is SQL code that you must type): create table MY_XML_TABLE If you describe the table, you will see its columns: desc MY_XML_TABLE Yo can now insert values into MY_XML_TABLE by calling XMLType's CREATEXML method: insert into MY_XML_TABLE (Key1, Xml_Column) You can query the data by calling the GETCLOBVAL method. This query select M.Xml_Column.GETCLOBVAL() as XML_DATA from MY_XML_TABLE M where Key1=1; returns this data: <book> For further information on XML please check Oracle9i Database Online
Documentation |
|