How to get all identity values generated by insert on DB2
final table clause
Use the clause final table in your insert statement, see the example below:
create table table_identity (cod1 int not null generated always as identity, cod2 int, cod3 int);
select * from final table (insert into table_identity (cod2,cod3) values (20,20),(30,30));
COD1 COD2 COD3
----------- ----------- -----------
1 20 20
2 30 30
1 record(s) selected.
No comments:
Post a Comment