Toad World® Forums

comparing collection


#1

Which example in the Quick Start Guide for Quest Code Tester for Oracle version 1.5.1 is best for understanding how to compare 2 collections? In the company where I work there are many utPLSQL procedures that compare the contents 2 PL/SQL tables. The programmers refer to the PL/SQL tables as arrays. For example, the package being tested declares in its specification two arrays like this:
TYPE VARCHAR2_ARRAY IS TABLE OF VARCHAR2(100);
TYPE VARCHAR_TABLE_ARRAY IS TABLE OF VARCHAR2_ARRAY;
The utPLSQL will call a function in the tested package which returns a VARCHAR_TABLE_ARRAY. The uPLSQL package creates and populates its own VARCHAR_TABLE_ARRAY and then compares the first and second array. The test is successful if the strings in array 1 are the same as array2. The comparison is done by means of nested FOR LOOPs. I can provide a sample of this exercise in utPLSQL if anyone is interested


#2

In the Quick Start Guide there are two samples of how to test collections:

Return collection of Strings (p. 18)
Return collection of Records (p.23)
When I was playing around with Nested Tables and Objects I did find a bug. Supplying the input parameters for my function had to be done through the initialization tab (Step 2. --> push “…” button)
Hope it helps.


#3

Thank you. I’ll try using the initialization section for better results.


#4

Jeff,

You definitely do always need to provide your own customziation code when testing the contents of collections. Over time, we will build UI elements to make this easier.

SF