db2 存储过程

-- 创建存储过程
BEGIN
	DECLARE i INTEGER DEFAULT 1;
	WHILE i <= 10000 DO
		INSERT INTO IKAS.ALAMDEFAULT
			(UID1, UID2, UID3, INT, VARCHARNOTNULL, "DOUBLE", "NULL", CREATETIME, INSERTTIME, DEFAULTABC)
			VALUES(i, i, i, i, '1', NULL, NULL, CURRENT TIMESTAMP, NULL, NULL);
		UPDATE IKAS.ALAMDEFAULT 
			SET INSERTTIME = CURRENT TIMESTAMP
			WHERE UID1=i;
		SET i = i + 1;
	END WHILE;
END;

DELETE FROM (SELECT * FROM IKAS.ALAMDEFAULT)

SELECT count(1) FROM IKAS.ALAMDEFAULT

  

posted @ 2023-07-25 18:29  AlamZ  阅读(15)  评论(0编辑  收藏  举报