--THIS FILE IS NEEDED ONLY FOR THE ONLINE UPDATE OR WHEN UPGRADING FROM VERSION 8.8.1.2!!!

create or replace procedure V8_UPD_LocatorRights is
  cursor OOO is
    select distinct wusr_wegr_id from wusr where wusr_wegr_id is not null and wusr_name not like 'Locator%';
  cooo OOO%rowtype;

begin

delete from wusr where WUSR_NAME like 'Locator%';

  for cooo in ooo loop
    insert into wusr values (seq_wusr.nextval, null, cooo.wusr_wegr_id, 'LocatorsDelete', 1); 
    insert into wusr values (seq_wusr.nextval, null, cooo.wusr_wegr_id, 'LocatorsEdit', 1);
    insert into wusr values (seq_wusr.nextval, null, cooo.wusr_wegr_id, 'LocatorsInsert', 1);
    insert into wusr values (seq_wusr.nextval, null, cooo.wusr_wegr_id, 'LocatorsView', 1);
  end loop;

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