I have a table defined as
CREATE TABLE MYTABLE (
BENEF_ID INT NOT NULL GENERATED ALWAYS AS IDENTITY(START WITH 1
INCREMENT BY 1),
LAST_NAME CHAR(20));
insert into mytable
(select sysibm.identity_val_local(),bnf_last_nm from
claimsa.tbeneficiary)
This gives the following error.
insert into mytable (select sysibm.identity_val_local(),bnf_last_nm
from claimsa.tbeneficiary)
DB21034E The command was processed as an SQL statement because it was
not a
valid Command Line Processor command. During SQL processing it
returned:
SQL0798N A value cannot be specified for column "BENEF_ID" which is
defined
as GENERATED ALWAYS. SQLSTATE=428C9