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

Creating XML from Relational Tables

Figure 9-1 shows an Entity-Relationship (ER) map of a set of relational tables storing purchase orders.

The seven tables include ORDER_TBL, ORDER_ITEM_TBL, CUSTOMER_TBL, PRODUCT_TBL, SUPPLIER_TBL, ACCOUNT_MGR_TBL, and COUNTRY_TBL tables (po_create_tables.sql) to store customers, sales, and order information (data inserted with po_insert_data.sql). Let’s use these tables to learn how to create XML from relational tables.

Using SQL/XML Functions

SQL/XML functions can be used to create XML document. Table 9-1 lists the SQL/XML functions in Oracle Database 11g.

Image

FIGURE 9-1. Purchase Order database Entity-Relationship ...

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