create or replace procedure UPDATE_YCMI_DISPLORDER is
 icnt integer;
 iYCMC_ID   integer;
 cursor C1 is select * from YCMI order by ycmi_ycmc_id,YCMI_longdesc;
 r1 C1%RowType;
begin
  iCnt:=1;
  iYCMC_ID:=0;
  for r1 in C1 loop
	 if iYCMC_ID <> r1.YCMI_YCMC_ID then
	    iYCMC_ID:=r1.YCMI_YCMC_ID;
		icnt:=1;
	 end if;  
     update YCMI set YCMI_DISPLORDER=iCnt where YCMI_ID=r1.YCMI_ID;
	 icnt:=icnt+1;
  end loop; 
end UPDATE_YCMI_DISPLORDER;
/


create or replace procedure V8_Update_YSTY_RIGHTS is
 cursor c1 is select ysty_shortdesc,ysty_longdesc from ysty;
 r1 c1%rowtype;
begin
  for r1 in c1 loop
    update WUSR set WUSR_NAME='Function Space Types'||r1.ysty_shortdesc||' '||r1.ysty_longdesc||'View' where WUSR_NAME='Function Space Types'||r1.ysty_longdesc||'View';
    update WUSR set WUSR_NAME='Function Space Types'||r1.ysty_shortdesc||' '||r1.ysty_longdesc||'Edit' where WUSR_NAME='Function Space Types'||r1.ysty_longdesc||'Edit';
    update WUSR set WUSR_NAME='Function Space Types'||r1.ysty_shortdesc||' '||r1.ysty_longdesc||'Insert' where WUSR_NAME='Function Space Types'||r1.ysty_longdesc||'Insert';
    update WUSR set WUSR_NAME='Function Space Types'||r1.ysty_shortdesc||' '||r1.ysty_longdesc||'Delete' where WUSR_NAME='Function Space Types'||r1.ysty_longdesc||'Delete';
  end loop;
end V8_Update_YSTY_RIGHTS;
/


commit;