1.
1个入参 返回值
function get_****t(p_deptid varchar2) return varchar2 as
o_result varchar2(50);
begin
select a.emp_no || '/' || a.emp_name
into o_result
from employee a
inner join **** b
on a.emp_id = b.emp_id
inner join **** c
on c.id = b.dept_position_id
inner join **** d
on d.id = c.dept_id
where exists (select 0
from ****
where form_kind = '****'
and field_name = '****'
and item_value = c.position_id)
and a.active = 'Y'
and rownum < 2
and d.dept_id = p_deptid;
return(o_result);
exception
when others then
return('');
end;
2.
procedur