inserting more than one row thru select statement
Posted: Thu Feb 25, 2016 9:56 pm
insert thru select is giivng error for multiple rows insert
---- copying data from db2 shipped sample databse
beow are table descriptions
following are the indexes
DEPTNO Primary, ascending
MGRNO Ascending
ADMRDEPT Ascending
my insert query
insert into dept
select * from DSN8910.dept;
---- 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;