Altova DatabaseSpy 2025 Enterprise Edition

Assigning XML Schemas

Home Prev Top Next

You can assign an XML schema to a database column (or, in IBM DB2 databases, to a data field) of type XML. This schema is used for data validation when an INSERT or UPDATE action is performed.

To assign an XML schema to a database column or field of type XML:

1.Depending on the database type, do one of the following:

 

In DB2 databases, and provided that the Result window is in the Editing mode, click the Browse ic_change-xml button in the XML data cell you want to edit, and choose Assign XML Schema from the menu that appears.

In SQL Server databases, right-click the column in the Online Browser and choose Assign XML Schema... from the context menu.

dbs_xml_schemas_04

2.Do one of the following:

 

Choose one of the XML schemas from the drop-down list (the list contains XML schemas registered with the database). Optionally, click Manage Schemas to add a schema to the database.

To remove any XML schema assignment from the column (or data cell if applicable), select None.

 

3.Click OK.

4.Depending on the database type, do one of the following:

 

In DB2 databases, click the Commit button in the Result Window.

In SQL Server databases, execute the change script in the Database Structure Change Script Window.

 

At this stage, DatabaseSpy validates the XML column or data cell against the assigned XML schema and reports any errors in the Message Window. If the validation fails, the XML schema assignment cannot be committed to the database.

© 2018-2024 Altova GmbH