open v_cursor for sqlstr; loop fetch v_cursor into v_acc_nbr; exit when v_cursor%notfound; perm_grid_ids(tempCount):= v_acc_nbr; tempCount := tempCount +1; end loop; close v_cursor; --如果权限网格ID为空则直接反回false
tempCount := 1; open v_cursor for'select r.grid_id from TB_PTY_GRID_SECTION_REL r where r.section_id = '||in_SectionId; loop fetch v_cursor into v_acc_nbr; exit when v_cursor%notfound; section_grid_ids(tempCount):=v_acc_nbr; tempCount := tempCount +1; end loop; close v_cursor; --判断包区的网格是不是都在权限网格之内
if(section_grid_ids.count>0)then for i in 1..section_grid_ids.count loop Result:=1; tempflag:=false; for j in 1..perm_grid_ids.count loop if(section_grid_ids(i)=perm_grid_ids(j))then tempflag:=true; exit; endif; end loop; if(tempflag=false)then Result:=0; goto label_end; endif; end loop; else Result:=0; endif; <<label_end>> return Result; exception when others then if(v_cursor%isopen)then close v_cursor; endif; errmsg :='ky'||sqlerrm; --dbms_output.put_line('ky' || sqlerrm);
open v_cursor for sqlstr; loop fetch v_cursor into v_acc_nbr; exit when v_cursor%notfound; perm_grid_ids.extend; --和上面的对比 perm_grid_ids(tempCount):= v_acc_nbr; tempCount := tempCount +1; end loop; close v_cursor; --如果权限网格ID为空则直接反回false
tempCount := 1; open v_cursor for'select r.grid_id from TB_PTY_GRID_SECTION_REL r where r.section_id = '||in_SectionId; loop fetch v_cursor into v_acc_nbr; exit when v_cursor%notfound; section_grid_ids.extend; section_grid_ids(tempCount):=v_acc_nbr; tempCount := tempCount +1; end loop; close v_cursor; --判断包区的网格是不是都在权限网格之内
if(section_grid_ids.count>0)then for i in 1..section_grid_ids.count loop Result:=1; tempflag:=false; for j in 1..perm_grid_ids.count loop if(section_grid_ids(i)=perm_grid_ids(j))then tempflag:=true; exit; endif; end loop; if(tempflag=false)then Result:=0; goto label_end; endif; end loop; else Result:=0; endif; <<label_end>> return Result; exception when others then if(v_cursor%isopen)then close v_cursor; endif; errmsg :='ky'||sqlerrm; --dbms_output.put_line('ky' || sqlerrm);