BEGIN
   FOR C_LANCACERTO IN (
      SELECT MAX(NRLANCACERTO) AS NRLANCACERTOMAX
        FROM LANCACERTO) LOOP

   UPDATE NOVOCODIGO
      SET NRSEQUENCIAL = LPAD(C_LANCACERTO.NRLANCACERTOMAX, 20, '0')
    WHERE CDCONTADOR = 'LANCACERTO';
END LOOP;
COMMIT;
END;
/