plsql - Call Oracle function with a cursor IN/OUT -
i trying make simple call function(test2) takes cursor, , returns cursor.
i stuck error:
error(23,17): pls-00306: wrong number or types of arguments in call 'test2'
what wrong function call?
v_resp := test2(v_req); here test:
create or replace type trans_obj object (transno char(8)); create or replace type trans_obj_tab table of trans_obj; create or replace function test2 (v_rc in sys_refcursor) return trans_obj_tab v_resp trans_obj_tab := trans_obj_tab(); begin v_resp.extend; v_resp(1) := trans_obj('222222'); return v_resp; end; create or replace function test1 return trans_obj_tab transno char(8); v_cnt number := 0; v_req trans_obj_tab := trans_obj_tab(); v_resp trans_obj_tab := trans_obj_tab(); --v_resp sys_refcursor; cursor v_rc select '1111' transno dual; begin open v_rc; loop fetch v_rc transno; exit when v_rc%notfound; v_req.extend; v_cnt := v_cnt + 1; v_req(v_cnt) := trans_obj(transno); end loop; close v_rc; v_resp := test2(v_req); return v_resp; end; / drop type trans_obj_tab; drop type trans_obj; drop function test1; drop function test2;
first not returning cursor test2 function says (try return sys_refcursor). on other hand v_req not sys_refcursor, besides v_resp can't contains cursor too. review types using. hope help!!!
Comments
Post a Comment