

Modifying Schema, View, Table, and Routine Definitions › Maintaining Tables › Adding a New Check Constraint
Adding a New Check Constraint
ALTER TABLE statement
To add a new check constraint, use the SQL DDL ALTER TABLE statement with the ADD CHECK option.
Considerations
- Adding a check constraint will append the new check constraint to any check constraints currently on the table
- If current data does not conform to the new check constraint, you will receive an error when CA IDMS/DB processes the ALTER TABLE command
Example
In the following example, a new check constraint is added to the BENEFITS table.
alter table emp.benefits
add check ( fiscal_year > 1920 );
Copyright © 2014 CA.
All rights reserved.
 
|
|