Unanswered: Loading a table with GENERATED BY DEFAULT AS IDENTITY
I am trying to load the data from EMPLOYEE table into EMPLOYEE_NEW table.Both the tables have the below structure.
EMPNO BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY ( START WITH +1 INCREMENT BY +1 MINVALUE +1 MAXVALUE +9223372036854775807 NO CYCLE CACHE 20 NO ORDER ),
LAST NAME NOT NULL,
FIRST NAME NOT NULL)
load cursor statements.
DECLARE CURSOR1 CURSOR FOR SELECT * FROM EMPLOYEE;
LOAD FROM CURSOR1 OF CURSOR MODIFIED BY IDENTITYOVERRIDE INSERT INTO EMPLOYEE_NEW;
SQL3526N The modifier clause "IDENTITYOVERRIDE" is inconsistent with the
current load command. Reason code: "5".
The IDENTITYOVERRIDE file type modifier cannot be used when loading a table with a GENERATED BY DEFAULT identity column.
What is the best solution to load the data into EMPLOYEE_NEW table and to retain the EMPNO from the EMPLOYEE table.
If you read the documentation then you would know that IDENTITYOVERRIDE is for GENERATED ALWAYS, not GENERATED BY DEFAULT. If you just remove that clause from the load, it should work the way you want it to.