IBM Database Add-Ins for Visual Studio

Validating XML Data in DB2 Tables and Views

If a table or view in your DB2® database is defined with one or more columns of data type XML, you can use the IBM® Data Designer to validate the XML data. You can validate the XML data in a single row of the result data grid in the designer. You can also validate the XML data in all the changed and new rows of a table or view that are displayed in the result data grid.

Single-row validation is a client-side operation that is performed by the add-ins. Validating the XML data in all the changed and new rows of the result data grid is a server-side operation that is performed by DB2.

Requirement:  The DB2 table or view must be defined with one or more columns of data type XML.

To validate the XML data in a single row of a DB2 table or view:

  1. Retrieve the data from the DB2 table or view.
  2. In the Result Data section, click the XML data cell in the row to validate, click the down arrow, and then click XML Designer on the shortcut menu.

    The DB2 XML Designer window opens.

  3. Expand the Advanced Options section.
  4. Select the XML schema to use for validating the XML data.
  5. Click Validate.
  6. If there are validation errors, fix the errors, and then click Validate again. Repeat this step until there are no validation errors.
  7. Click OK in the DB2 XML Designer window.
  8. In the Data view of the IBM Data Designer, save the data.

To validate the XML data in all the changed and new rows that are displayed in the result data grid:

  1. Retrieve the data from the DB2 table or view.
  2. In the Options section, click the Validate cell for the database column, and then click Ellipsis button.

    The Validate window opens.

  3. In the XML schema name column, select the name of the registered XML schema to use to validate the XML data, and then click OK.
  4. In the Data view of the designer, save the data.

    Validation occurs as the data is being saved.

  5. If there are validation errors, fix the errors, and then save the data again. Repeat this step until there are no validation errors.

See Also

IBM Data Designer


.NET Development Forum   DB2 FAQs

© Copyright IBM Corporation 2002, 2019. All Rights Reserved.