Sybase XML manual Defining identity constraints, Defining a unique constraint

Models: XML

1 290
Download 290 pages 48.58 Kb
Page 76
Image 76

Defining identity constraints

Defining identity constraints

Identity constraints enable you to indicate that element values must be unique within their specified scope.

There are three kinds of identity constraints: unique, key and keyRef.

Each identity constraint has two specific attributes: selector and field.

In a schema, an identity constraint is declared with its corresponding tag: <unique>, <key> or <keyRef>.

Identity constraints are only available in a model targeted with XSD.

Defining a unique constraint

A unique constraint specifies that an element or an attribute value (or set of values) must be unique or null within a specified scope.

For example:

Generated schema:

64

PowerDesigner

Page 76
Image 76
Sybase XML manual Defining identity constraints, Defining a unique constraint