Oracle: How to Test Stored Procedure

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.

About the Author

Tarun

There are very few sites where you find some technical stuff in hindi language. So to promote hindi and to provide some technical news / tips / articles, he has created this blog.

[Your kind of comment is welcome, these incentives is with them, they are also shows that the stories of how you people than that. And if you like the control panel directly by email Subscribe to the can or in the feed reader Subscribe to also can read]

Leave a Reply

You can use these XHTML tags: <a href="" title=""> <abbr title=""> <acronym title=""> <blockquote cite=""> <code> <em> <strong>