create or replace procedure V8_UPD_CRSNumberRights is
  cursor OOO is
    select distinct wusr_wegr_id from wusr where wusr_wegr_id is not null and wusr_name not like 'ReservationEnter CRS ID manually';
  cooo OOO%rowtype;

begin

delete from wusr where WUSR_NAME like 'ReservationEnter CRS ID manually';

  for cooo in ooo loop
    insert into wusr (WUSR_ID, WUSR_NAME, WUSR_VALUE, WUSR_WEGR_ID, WUSR_XCMS_ID) values (seq_wusr.nextval, 'ReservationEnter CRS ID manually', 1, cooo.wusr_wegr_id, null); 
  end loop;

  exception
    when no_data_found then
      raise; --null;
    when others then
      raise; --null;  
end V8_UPD_CRSNumberRights;
/
