Task 3: Use the Db2 LOAD utility to load data into a table that has a foreign key constraint defined
In this task, you will use the Db2 LOAD utility to add data to the STOCK table and resolve integrity constraints using the SET INTEGRITY command.
-
Run the LOAD Command:
Use the LOAD command in the file load_stock1.ddl to load data into the STOCK table.
cd $HOME/ddl
db2 connect to musicdb
db2 -tvf load_stock1.ddl
-
Run the SET INTEGRITY Command:
Use the set_integrity_stock.sql file to run SET INTEGRITY and resolve any pending integrity constraints.
db2 -tvf set_integrity_stock.sql
Ensure that all referential and check constraints are correctly defined and that the data being loaded complies with these constraints.
By completing this task, you have successfully loaded data into the STOCK table and resolved integrity constraints using the SET INTEGRITY command.