Toad World® Forums

executing/counting the record from ref cursor



I have a function which is returning data in a refe cursor. But the ref cursor is getting data by calling another function and procedures.

So, I dont have any select stament or direct query to compare the result. This ref cursor internally calling many funcions and proecdures based on the input parameters.

Please suggest how will i check this ref cursor in the test case and also guide me how to check that the ref cursor count is greate than 0.

Thanks in advance.


Is there any way to solve this issue. If any body has any solution to get out of this problem then please reply to this thread as I am stuck up in the middle of the issue.


Is every time you call your function this cursor has different content?


Yes , the function is returning different content in each call.


As you know the main idea of unit testing is comparison results with expected values.

What to do if it is difficult to determine expected value(s)?

  1. Try to use different test types. Depending on data type of unit results Code Tester provides a set of test type. Press button in test type editor and for ref cursors you will se all possible test types:
  2. Additional help you can have using Run-to-test future. If you use the same inputs like in your test case you will get ref cursor value content in a grid. It can help you to think of test types and expected value(s).