Databases Reference
In-Depth Information
<actor gender="M">Sam Allen</actor>
<actor gender="M">Chris Plummer</actor>
<actor gender="F">Linda Collins</actor>
<actor gender="M">Bill Hagen</actor>
</actors>
</credits>
</movie>'
The sample data for Movie review is shown in Example 2-2.
Example 2-2 Moviereview.xml
<movie id = "345">
<reviews>
<UserReview>
<user name ="Andy">Three is a crowd, yet there are not enough stars
to support this catastrophe.</user>
<user name ="Linda">I really liked this movie.</user>
</UserReview>
<CriticsReview>
<newspaper name="ABC Times">The best mystery thriller of the year.
</newspaper>
<newspaper name="San Francisco Post">Its ok...movie.
</newspaper>
</CriticsReview>
</reviews>
</movie>
You can find the complete data for Example 2-1 on page 57 and Example 2-2 in
Appendix A, “Setup procedure and sample data” on page 295.
All the example queries in this chapter have been tested against the movie and
moviereview data in the DB2 9 database. We advise you to follow the setup
steps mentioned in the Appendix A, “Setup procedure and sample data” on
page 295 to get the desired result from these example queries.
2.2.5 SQL support for XML data (INSERT, SELECT)
In DB2 9, SML is a new supported data type. In the CREATE TABLE statement,
the XML data type can be specified as a column data type. Just like other data
types, while inserting an XML value in the column of type XML, DB2 makes sure
that the data type of a value is XML.
XML value is made of nodes of different data types and can be represented and
stored in any of the character types, such as CHAR, VARCHAR, CLOB, BLOB,
Search WWH ::




Custom Search