Toad World® Forums

Number of records returned by a ref cursor


#1

Apologies if this is a really stupid noob question:

I have a procedure which is returning a ref cursor and I want to use code tester to check the number of rows returned in the cursor. How do I do it?

Thanks in advance

Lee


#2

In Test Builder, you should have an outcome for the OUT param that is the SYS_REFCURSOR. Click the … in the Changed By Program and enter in a select statement that mimics the columns that the cursor returns. This is used by QCTO to figure out the number of columns and data types returned by the cursor. Now, set the Operator column to ‘#=’, and set the Expected Results to Integer and the expected number of rows.