tags:

views:

4664

answers:

2

Here the Package..

CREATE OR REPLACE PACKAGE G_PKG_REFCUR AS
    TYPE rcDataCursor IS REF CURSOR;
END;

Let's consider the PROC..

Create procedure gokul_proc(
    pId in number,
    pName in varchar2,
    OutCur OUT G_PKG_REFCUR.rcDataCursor ) is
BEGIN
    Open OutCur For
        select * from gokul_table ob 
        where ob.active_staus-'Y' AND ob.id=pId AND ob.name=pNname;
END;

Here is my question: HOW TO EXECUTE THIS PROCEDURE????

If no OutCur Parameter, then i execute like this..

EXEC gokul_proc(1,'GOKUL');

but, the problem is OutCur.. i dono which value to pass here.. ie,

EXEC gokul_proc(1,'GOKUL', ??????);

I don want to change any thing in my code.. i jus need to know what value to pass as a argument for the procedure???

Pls.. help me.. thanks in advance..

+1  A: 

In SQL Plus:

VAR rc REFCURSOR
EXEC gokul_proc(1,'GOKUL', :rc);
Tony Andrews
A: 

but it shows SP2-640: Not Connected SP2-641: "Execute" require connection to server

asgusfl