You can use the "alter table" syntax in
Oracle to add constraints in this form:
alter table
table_name
add constraint
constraint_name;
The following shows how to add
constraints the the Oracle foreign key:
alter table
cust_table
add constraint
fk_cust_name FOREIGN KEY (person_name)
references
person_table (person_name)
initially
deferred deferrable;
Here is an example of adding a
multiple column foreign key constraint:
alter table
cust_table
add constraint
fk_cust_name FOREIGN KEY (person_name,
person_gender)
references
person_table (person_name,
person_gender)
initially deferred deferrable;
Last, we use the Oracle "alter
table" syntax to add a check constraint.
alter table
cust_table
add constraint
check_cust_types
CHECK
(cust_type IN
(
'yuppie',
'dink',
'guppie'
)
);