|
Hello,
I'm making a function A that does many calls to procedures in an other package B. To make this function more readable, I'd like to specify synonyms for the procedures in B. I only need the synonyms inside this function, I don't want to make database synonyms. Is this possible?
For example:
Function get_all_employees return clob is v_emp clob; begin for i in (select name,function,dept from employee) loop pck_json.g_array := ''; pck_json.add_value_to_array(i.name); pck_json.add_value_to_array(i.function); pck_json.add_value_to_array(i.dept); pck_json.finish_array; pck_json.add_array_to_array(pck_json.g_array); end loop; pck_json.finish_nested_array; v_emp := pck_json.g_nested_array; return v_emp; end;
-------------------- with private synonyms i could do this: -------------------- Function get_all_employees return clob is v_emp clob;
a is synonym of pck_json.g_array; na is synonym of pck_json.g_nested_array; add is synonym of pck_json.add_value_to_array; arr2arr is synonym of pck_json.add_array_to_array finish_a is synonym of pck_json.finish_array; finish_na is synonym of pck_json.finish_nested_array; begin for i in (select name,function,dept from employee) loop a := ''; add(i.name); add(i.function); add(i.dept); finish_a; arr2arr (a); end loop; finish_na; v_emp := na; return v_emp; end;
|