1.DB2自增主键
create table DB2_ZZZJ
(T_ID bigint primary key not null generated by default as identity(start with 1 increment by 1),
T_CHAR char(50),
T_VARCHAR varchar(50)
);
自增主键表插数据
--/
CREATE PROCEDURE insert_DB2_ZZZJ()
BEGIN
DECLARE MyCounter integer;
SET MyCounter =1;
WHILE MyCounter <= 100 do
insert into DB2_ZZZJ(T_CHAR,T_VARCHAR) values('aaa','bbb');
commit;
SET MyCounter = MyCounter +1;
END WHILE;
END
/
call insert_DB2_ZZZJ;
drop procedure insert_DB2_ZZZJ;
2.DM自增主键
create table DM_ZZZJ
(T_ID bigint IDENTITY(1,1) not null,
T_CHAR char(12) null,
T_VARCHAR varchar(12) null,
PRIMARY KEY(T_ID)
);
自增主键表插数据
BEGIN
FOR V_count IN 1..10 LOOP
INSER