Toad World® Forums

Testing Ref Cursor Output


I am trying to write test cases to test the following procedure:

get_thermal_print_carriers(pi_user_gid IN VARCHAR2,
po_refcur OUT t_refcur,
po_err_code OUT VARCHAR2,
po_err_msg OUT VARCHAR2)

t_refcur IS a weakly defined cursor.

I have successfuly managed to write test case that check the count of records that are returned in the cursor but am having difficulty with checking the data returned in the cursor.

Any suggestions on how this should be done would be greatly appreciated.




First, I suggest you check out the Help Doc, Quick Start Tutorials, Testing Contents of Cursor Variable.

That should help.

Most commonly, you would compare the contents of the cursor variable to a query or a table. So you can populate a “control” table with the columns and data you expect in that CV. Then set up an outcome with that table as the Expected Results. Code Tester will do the rest of the work for you.



Thanks for your help. I had a look in the help but was struggling to find what I was looking for. Didn’t look at the Quick Starts though.

I have succeded in getting this to work now.