O'Reilly logo

Oracle Database 11g: Building Oracle XML DB Applications by Jinyu Wang

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Loading XML into Relational Tables

Loading XML data into relational tables is needed when we receive XML data from other applications. The available approaches include using the XMLTable() function, creating SQL/XML or XQuery views instead of triggers, using DBMS_XMLSTORE, and using the Oracle XDK Java XSU oracle.xml.sql.dml.OracleXMLSave package. Among these approaches, using XMLTable() is the easiest approach and thus is the method we will discuss now.

To load XML data into relational tables with XMLTable(), you need to insert XML from the relational view created by XMLTable(). For example, the following table stores email templates (loading_xml.sql):

Listing 9-9 Inserting Data to Relational Table Using XMLTable() View

CREATE TABLE email_template_tbl ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required