Calling packaged procedure with Refcursor as out parameter over DBlink [message #525956] |
Fri, 07 October 2011 02:09 |
|
himanshu2704
Messages: 1 Registered: October 2011 Location: Chandigarh
|
Junior Member |
|
|
Hi!
I have a requirement in which I have to call a packaged procedure created in one database DB1 to other database DB2 through a DBLink. The packaged procedure to be called has refcursor as OUT parameter.
When I run the procedure in DB1 , it works fine:
Declare
v_ref_data SYS_REFCURSOR;
a1 Number;
b1 varchar2(100);
c1 varchar2(100);
Begin
apps.XXCU_DB1_PKG.get_DB1('101062','9138', v_ref_data);
FETCH v_ref_data into a1,b1,c1;
dbms_output.put_line(a1|| ' '|| b1|| ' '|| c1);
End;
When I run the packaged procedure from DB2 using DBlink, it gives error:
Declare
v_ref_data SYS_REFCURSOR;
a1 Number;
b1 varchar2(100);
c1 varchar2(100);
Begin
apps.XXCU_DB1_PKG.get_DB1@dblink('101062','9138', v_ref_data);
FETCH v_ref_data into a1,b1,c1;
dbms_output.put_line(a1|| ' '|| b1|| ' '|| c1);
End;
Error report:
ORA-24338: statement handle not executed
ORA-06512: at line 14
24338. 00000 - "statement handle not executed"
*Cause: A fetch or describe was attempted before executing a
statement handle.
*Action: Execute a statement and then fetch or describe the data.
anonymous block completed
Kindly help me in this. I read somewhere on other forums that refcursors can not be passed through the DB links, is it true??
Thanks in Advance
Regards
Himanshu Mittal
|
|
|
|