通过使用游标获取数据,然后修改其中的值,达到复制并修改数据的目的;
DECLARE
BEGIN
FOR RS IN (SELECT * FROM TM_TRANSIT_BAR_NEW_CONFIG WHERE TRANSIT_CODE = '577W') LOOP
RS.ID := SEQ_TM_TRANSIT_BAR_NEW_CONFIG.NEXTVAL;
RS.TRANSIT_CODE := '577W1';
INSERT INTO TM_TRANSIT_BAR_NEW_CONFIG VALUES RS;
END LOOP;
COMMIT;
END;