This tutorial teaches you how to create and register
an XML schema on DB2®. You can create an XML schema and then edit it using
the XML schema editor. Using the XML schema editor, you can specify element
names that indicate which elements are allowed in an XML file, and in which
combinations. Use the Register an XML Schema wizard to register the XML schema
on a DB2 database.
You can then use the registered XML schema to validate the insertion or update
of XML data into an XML column.
Learning objectives
When
you complete the exercises, you will know how to do the following tasks:
- Connect to the DB2 SAMPLE database and create a data development project
to work with the database
- Run a script to create additional tables in the database
- Use the XSD editor to create an XML document for your XML schema
- Register the XML schema
- Use the XML schema to validate XML column data
This tutorial should take approximately 60 minutes to finish.
If you explore other concepts related to this tutorial, it could take longer
to complete.
Skill level
Advanced
Audience
Database developers
System requirements
- You must install and configure the SAMPLE database that is included with DB2 for Linux, UNIX,
and Windows.
The SAMPLE database must support XML objects and data. To support XML objects
and data, you must create the database with the appropriate Unicode and UTF-8
options. See the DB2 documentation and First Steps for more information.
Prerequisites
In order to complete this tutorial,
you should be familiar with the following concepts:
- Database development
- XML schemas