CHAPTER 7 Ensuring Data Integrity
281
•
You can replace a CHECK condition on a column in the same way as you
would add a CHECK condition. The following statement adds or replaces
an unenforced CHECK condition on the
phone
column of the
customer
table:
ALTER TABLE customer
MODIFY phone
CHECK ( phone LIKE ’___-___-____’ )
UNENFORCED
There are two ways of modifying a CHECK condition defined on the table, as
opposed to a CHECK condition defined on a column.
•
You can add a new CHECK condition using ALTER TABLE with an ADD
table-constraint clause.
•
You can delete all existing CHECK conditions, including column CHECK
conditions, using ALTER TABLE DELETE CHECK, and then add in new
CHECK conditions.
All CHECK conditions on a table, including CHECK conditions on all its
columns and CHECK conditions inherited from user-defined data types, are
removed using the ALTER TABLE statement with the DELETE CHECK
clause, as follows:
ALTER TABLE table_name
DELETE CHECK
Deleting a column from a table does not delete CHECK conditions associated
with the column that are held in the table constraint. If the constraints are not
removed, any attempt to query data in the table will produce a column not
found error message.
Declaring entity and referential integrity
The relational structure of the database enables the database server to identify
information within the database. Adaptive Server IQ also ensures that primary
key-foreign key relationships between tables are properly upheld by all the
rows in any join index relying on these relationships.
Summary of Contents for Adaptive Server IQ 12.4.2
Page 1: ...Administration and Performance Guide Adaptive Server IQ 12 4 2 ...
Page 16: ...xvi ...
Page 20: ...Related documents xx ...
Page 40: ...Compatibility with earlier versions 20 ...
Page 118: ...Troubleshooting startup shutdown and connections 98 ...
Page 248: ...Importing data by replication 228 ...
Page 306: ...Integrity rules in the system tables 286 ...
Page 334: ...Cursors in transactions 314 ...
Page 396: ...Users and permissions in the system tables 376 ...
Page 438: ...Determining your data backup and recovery strategy 418 ...
Page 484: ...Network performance 464 ...
Page 500: ...System utilities to monitor CPU use 480 ...
Page 514: ...Characteristics of Open Client and jConnect connections 494 ...
Page 536: ...Index 516 ...