怎么用啊, 教教我我写了create or replace function IsManager (i_staffno in staff.staffno%type) return boolean is v_staffno staff.staffno%type; cursor isManager_cur is select staffno from manager; begin open isManager_cur; fetch isManager_cur into v_staffno; while isManager_cur%found loop if v_staffno = i_staffno then return true; else fetch isManager_cur into v_staffno; end if; end loop; return false; end; /感觉效率不高, 不知道有更好的没
楼主啥意思呢 是不是想检查检查字段有没含有“manager”子串? select * from manager where instrb(lower(position),'manager') >0;
(i_staffno in staff.staffno%type)
return boolean
is
v_staffno staff.staffno%type;
cursor isManager_cur is
select staffno from manager;
begin
open isManager_cur;
fetch isManager_cur into v_staffno;
while isManager_cur%found loop
if v_staffno = i_staffno then
return true;
else
fetch isManager_cur into v_staffno;
end if;
end loop;
return false;
end;
/感觉效率不高,
不知道有更好的没
是不是想检查检查字段有没含有“manager”子串?
select * from manager where instrb(lower(position),'manager') >0;