IBM Database Add-Ins for Visual Studio

Changing 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 change XML data in rows of the table or view.

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

To change XML data in a DB2 table or view:

  1. Retrieve the data from the DB2 table or view.
  2. In the Result Data section, click the cell in which to change the XML data, click the down arrow, and then select XML Designer on the drop-down menu.

    The DB2 XML Designer window opens.

  3. Optional: Type your changes to the XML source on the Text View page.
  4. Optional: Click the Grid View tab, expand the hierarchical grid until a data table is displayed, and then type your data changes in the table.
  5. Optional: Generate sample XML to use as a template for new XML data.
    1. Click the Sample XML tab.
    2. Expand the Advanced Options section.
    3. Select the XML schema to use to generate the sample XML.
    4. Click Generate Sample.
    5. If the schema that you selected contains more than one root element, in the Select Root window, select the root to use for generating the sample XML.
    6. Use commands on the shortcut menu to select and copy the sample XML, and then paste it in the Text View page.
    7. Change the element text and attribute values in the sample XML to the text and values that you want.
  6. Optional: Click Open File, and then browse to and select the file that contains the XML data to use in the cell.

    The contents of the file that you select are displayed in the Text View page.

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

See Also

IBM Data Designer


.NET Development Forum   DB2 FAQs

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