create or replace procedure V8_UPD_FIXOOORIGHTS is
  cursor OOO is
    select distinct wusr_wegr_id from wusr where wusr_wegr_id is not null;
  cooo OOO%rowtype;

begin
  for cooo in ooo loop
    insert into wusr values (seq_wusr.nextval, null, cooo.wusr_wegr_id, 'HousekeepingOut of OrderDelete', 1); 
    insert into wusr values (seq_wusr.nextval, null, cooo.wusr_wegr_id, 'HousekeepingOut of OrderInsert', 1); 
    insert into wusr values (seq_wusr.nextval, null, cooo.wusr_wegr_id, 'HousekeepingOut of OrderEdit', 1); 
    insert into wusr values (seq_wusr.nextval, null, cooo.wusr_wegr_id, 'HousekeepingOut of OrderView', 1); 

    insert into wusr values (seq_wusr.nextval, null, cooo.wusr_wegr_id, 'HousekeepingOut of Service', 1); 
    insert into wusr values (seq_wusr.nextval, null, cooo.wusr_wegr_id, 'HousekeepingOut of ServiceDelete', 1); 
    insert into wusr values (seq_wusr.nextval, null, cooo.wusr_wegr_id, 'HousekeepingOut of ServiceInsert', 1); 
    insert into wusr values (seq_wusr.nextval, null, cooo.wusr_wegr_id, 'HousekeepingOut of ServiceEdit', 1); 
    insert into wusr values (seq_wusr.nextval, null, cooo.wusr_wegr_id, 'HousekeepingOut of ServiceView', 1); 
  end loop;

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