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);
sql>print myData;
01101 and 07/06/2004 these two are input parameters and myData gets the data returned by procedure.
4 Responses
Mily
February 14th, 2007 at 10:38 pm
1Perfect!
Robert
October 2nd, 2007 at 9:40 am
2Not enough info. You should show an example of the procedure you are calling, and the data that is returned.
Yogesh bajpai
March 31st, 2008 at 4:04 am
3Hi,
how can we test the procedue.
Tarun
March 31st, 2008 at 8:22 am
4@Robert, thanks for your input. I will post an example, actually I wrote this as my note for myself so didn’t go in detail.
@Yogesh, it depends what kind of procedure, which databae?
RSS feed for comments on this post · TrackBack URI
Leave a reply
Categories
Archives
Meta
Calendar
निठल्ला चिंतन
Recent Entries
Recent Comments
Most Commented
Zero Hour is proudly powered by WordPress - BloggingPro theme by: Design Disease