Translations of this page?:

Add Unique Constraint

Adds a unique constrant to an existing column or set of columns.

Sample

<addUniqueConstraint tableName="person"
    columnNames="id"
    constraintName="pk_person"/>

Available Attributes

tableName Name of the table to create the unique constraint on [required]
schemaName
columnNames Name of the column(s) (comma separated if mulitiple) to create the unique constraint on [required]
constraintName Name of unique constraint [required]
tablespace “Tablespace” (file group in SQL Server) to create the index in

Database Compatiblity

MySQL Does not support tablespaces
PostgreSQL No Issues
Oracle No Issues
MS-SQL No Issues
Sybase No Issues
DB2 Does not support specifying tablespace when adding constraints to a table
Derby Does not support tablespaces
HSQL Does not support tablespaces
H2 Does not support tablespaces
Caché Does not support tablespaces
Firebird No Issues
MaxDB No Issues

Automatic Rollback Support: YES

 
manual/add_unique_constraint.txt · Last modified: 2008/03/18 07:08 (external edit)     Back to top