---- copying data from db2 shipped sample databse
beow are table descriptions
CREATE TABLE DEPT
(DEPTNO CHAR(3) NOT NULL,
DEPTNAME VARCHAR(36) NOT NULL,
MGRNO CHAR(6) ,
ADMRDEPT CHAR(3) NOT NULL,
LOCATION CHAR(16) ,
PRIMARY KEY (DEPTNO) )
IN mydatabase
ALTER TABLE DEPT
FOREIGN KEY RDD (ADMRDEPT) REFERENCES DBMATE01.DEPT
ON DELETE CASCADE;
(DEPTNO CHAR(3) NOT NULL,
DEPTNAME VARCHAR(36) NOT NULL,
MGRNO CHAR(6) ,
ADMRDEPT CHAR(3) NOT NULL,
LOCATION CHAR(16) ,
PRIMARY KEY (DEPTNO) )
IN mydatabase
ALTER TABLE DEPT
FOREIGN KEY RDD (ADMRDEPT) REFERENCES DBMATE01.DEPT
ON DELETE CASCADE;
following are the indexes
DEPTNO Primary, ascending
MGRNO Ascending
ADMRDEPT Ascending
my insert query
insert into dept
select * from DSN8910.dept;