Ref. Cursor is used to get back data from oracle in data set or cursor format. Sometimes it happens that the front end is not ready and you may need to test the procedure for the result set. It’s very easy and simple to test a stored procedure which returns data in forms of Ref. Cursor.
Let’s say you have stored procedure sp_myFirst_proc and there is 2 input parameters and 1 output parameter to return the data (ref. cursor data type). To verify the data, first logged in into Oracle Sql*Plus, once logged in you will have command window showing the sql> prompt. Type as below:
sql>variable myData refcursor;
sql>execute sp_myFirst_proc('01101', '07/06/2004', :myData);
01101 and 07/06/2004 these two are input parameters and myData gets the data returned by procedure.