Using table and column constraints
280
Working with column constraints in Sybase Central
All adding, altering, and deleting of column constraints in Sybase Central is
carried out in the Constraints tab of the column properties sheet.
❖
To display the property sheet for a column:
1
Connect to the database.
2
Click the Tables folder for that database, and click the table holding the
column you wish to change.
3
Double-click the Columns folder to open it, and double-click the column
to display its property sheet.
For more information, see the Sybase Central online Help.
Using CHECK conditions on tables
A CHECK condition can be applied as a constraint on the table, instead of on
a single column. Such CHECK conditions typically specify that two values in
a row being entered or modified have a proper relation to each other. Column
CHECK conditions are held individually in the system tables, and can be
replaced or deleted individually. This is more flexible behavior, and CHECK
conditions on individual columns are recommended where possible.
For example, in a library database, the
date_returned
column for a particular
entry must be later than (or the same as) the
date_borrowed
entry:
ALTER TABLE loan
ADD CHECK(date_returned >= date_borrowed) UNENFORCED
Modifying and deleting CHECK conditions
There are several ways to alter the existing set of CHECK conditions on a table.
•
You can add a new CHECK condition to the table or to an individual
column, as described above.
•
You can delete a CHECK condition on a column by setting it to NULL.
The following statement removes the CHECK condition on the
phone
column in the
customer
table:
ALTER TABLE customer MODIFY phone
CHECK NULL
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 ...