BEGIN FOR i IN 1 .. {count_insert} LOOP INSERT INTO IKASTRIGGER.IKAS10B (COLUMN1, COLUMN2, COLUMN3, COLUMN4, COLUMN5, COLUMN6, COLUMN7, COLUMN8, COLUMN9, COLUMN10) VALUES(substr(sys_guid(),0,9)||i, to_char(systimestamp, 'yyyy-mm-dd hh24:mi:ss.ff6'), i, i,substr(sys_guid(),0,9),substr(sys_guid(),0,9),substr(sys_guid(),0,9),substr(sys_guid(),0,9),substr(sys_guid(),0,9),substr(sys_guid(),0,9)); COMMIT; INSERT INTO IKASTRIGGER.IKAS10A (COLUMN1, COLUMN2, COLUMN3, COLUMN4, COLUMN5, COLUMN6, COLUMN7, COLUMN8, COLUMN9, COLUMN10) VALUES(substr(sys_guid(),0,9)||i, to_char(systimestamp, 'yyyy-mm-dd hh24:mi:ss.ff6'), i, i,substr(sys_guid(),0,9),substr(sys_guid(),0,9),substr(sys_guid(),0,9),substr(sys_guid(),0,9),substr(sys_guid(),0,9),substr(sys_guid(),0,9)); COMMIT; END LOOP; END;
BEGIN FOR v_row IN (select COLUMN1 from IKASTRIGGER.ALAMTEST1 sample(50) WHERE rownum <={int(count_update/2)} and COLUMN3 is null UNION ALL select COLUMN1 from IKASTRIGGER.ALAMTEST1 sample(50) WHERE rownum <={int(count_update/2)} and COLUMN3 is not null) LOOP UPDATE IKASTRIGGER.ALAMTEST1 SET COLUMN3 = to_char(systimestamp, 'yyyy-mm-dd hh24:mi:ss.ff6'), COLUMN4 = substr(sys_guid(),5,14) WHERE COLUMN1 = v_row.COLUMN1; COMMIT; END LOOP; END;
BEGIN FOR v_row IN (select COLUMN1 from IKASTRIGGER.ALAMTEST1 sample(50) WHERE rownum <={ount_delete}) LOOP delete from IKASTRIGGER.ALAMTEST1 WHERE COLUMN1 = v_row.COLUMN1; COMMIT; END LOOP; END;
标签:存储,BEGIN,sys,substr,造数,oracle,guid,COLUMN1,IKASTRIGGER From: https://www.cnblogs.com/alamZ/p/18311514