-- two dashes mean a comment in DB2 for VM and z/OS
-- 1st design your table - considered optional
-- 2nd declare your table - maditory. You still can not alter a table that
-- does not exist
-- 3rd alter the table to add the foreign key
-- DB2 for FOREIGN KEY
ALTER TABLE owner.Tablename
ADD CONSTRAINT name FOREIGN KEY (column name(s) )
REFERENCES REDBA.RESF_FINAL_CARD (column name(s) )
ON DELETE RESTRICT -- means stop them
or
ON DELETE cascade -- Cascade means to delete everthing here
or
ON DELETE SET value -- update the value of the column
;
-- note since you are doing DDL not dml the commit is implicit!! so
-- there is no COMMIT WORK needed
how to connect the rad to db2
The DB2 is owned by Aston Martin.
The key foreign policy makers are?
congress
yes .a foreign key can have null values
Yes, DB2 install is available for PCs (Windows)
False. A foreign key is a primary of one table that is in another table. A foreign key can be repeated, so it does not uniquely identify records in the table where it is a foreign key.
the foreign key referential between two tables.
3 Foreign key
yep foreign key can have duplicate values
stay out of foreign conflict
The foreign key is a reference to a key (identifier) of a row in another or even the same table. When the foreign key is not null, it implies that there's an entry in the referenced table with that identifier. The syntax depends on wich database are you using, check the page in the related links below.