-- $Revision $
SET ECHO ON
SPOOL xAADS#18467

UPDATE cnt_contract
SET cnt_contract_nummer_intern = TO_NUMBER (cnt_contract_nummer_intern) + 100
WHERE cnt_contract_key IN
            (SELECT c1.cnt_contract_key
             FROM cnt_contract c1, cnt_contract c2
             WHERE c1.cnt_contract_nummer_intern =
                      c2.cnt_contract_nummer_intern
                   AND COALESCE (c1.cnt_contract_versie, '99') <>
                         COALESCE (c2.cnt_contract_versie, '99')
                   AND c1.cnt_contract_versie IS NULL);

DECLARE
  v_count NUMBER;
  v_dummy NUMBER;
BEGIN
  v_count := 0;
  WHILE v_count < 100 LOOP
    select CNT_S_CNT_CONTRACT_KEY.nextval
     into v_dummy
     from dual;
    v_count:=v_count+1;
  END LOOP;
END;

COMMIT;

SPOOL OFF