Chapter 3 Building Physical Diagrams


Creating an XML table or view

Some DBMS support tables and views of XML type.

An XML table is used to store an XML document, it does not contain columns. It is possible to associate this table with an XML schema registered in a relational database, in this case the schema is used to validate the XML document stored in the table.

XML table additional properties

If you select the XML type in the Type dropdown listbox, the Column page disappears and the following additional properties appear in the table property sheet:

Property Description
Schema Allows you to enter the target namespace or the name of an XML model. The schema must be registered in the database to be used for validating XML documents.

- You can type a user-defined schema name

- You can click the Select a registered schema button to connect to an ODBC data source and select a registered schema in the database

- If you select an element from an XML model open in the PowerDesigner workspace, the Schema property is automatically initialized with the XML model target namespace. Note that this schema must also be registered in the database to be used for validating XML documents
Element Allows you to select a root element in the XML document.

- You can type a user-defined element name

- You can also click the Select an element button to select an element from the XML models open in the workspace or from the schema registered in the database

Steps To create an XML table:

  1. Right-click the Table category in the Browser and select New.

    The property sheet of a new table appears.
  2. Type a table name and a table code.
  3. In the Type dropdown listbox, select XML.

    The Columns tab disappears and the Schema and Element boxes appear in the lower part of the General tab.
  4. In the Schema box, type the target namespace or name of an XML model or use the Select a registered schema button to select among the registered schema in a selected database.
  5. In the Element box, type the name of the root element of the selected schema.
  6. Click OK.

 


Copyright (C) 2005. Sybase Inc. All rights reserved.