Working With Column Constraints In Sybase Central; Using Check Conditions On Tables; Modifying And Deleting Check Conditions - Sybase Adaptive Server IQ 12.4.2 Administration And Performance Manual

Table of Contents

Advertisement

Using table and column constraints

Working with column constraints in Sybase Central

Using CHECK conditions on tables

Modifying and deleting CHECK conditions

280
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.
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
entry must be later than (or the same as) the
ALTER TABLE loan
ADD CHECK(date_returned >= date_borrowed) UNENFORCED
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
column in the
customer
ALTER TABLE customer MODIFY phone
CHECK NULL
date_returned
date_borrowed
table:
column for a particular
entry:
phone

Advertisement

Table of Contents
loading

Table of Contents