You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/userguide/advanced_data_comparison.md
+24Lines changed: 24 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,6 +23,9 @@ Advanced data-comparison options are available for the [`equal`](expectations.md
23
23
-`exclude(a_items varchar2)` - item or comma separated list of items to exclude
24
24
-`include(a_items ut_varchar2_list)` - table of items to include
25
25
-`exclude(a_items ut_varchar2_list)` - table of items to exclude
26
+
-`unordered` - perform compare on unordered set of data, return only missing or actual
27
+
-`join_by(a_columns varchar2)` - columns or comma seperated list of columns to join two cursors by
28
+
-`join_by(a_columns ut_varchar2_list)` - table of columns to join two cursors by
26
29
27
30
Each item in the comma separated list can be:
28
31
- a column name of cursor to be compared
@@ -92,6 +95,27 @@ Only the columns 'RN', "A_Column" will be compared. Column 'SOME_COL' is exclude
92
95
93
96
This option can be useful in scenarios where you need to narrow-down the scope of test so that the test is only focused on very specific data.
94
97
98
+
## Join By option
99
+
You can now join two cursors by defining a primary key or composite key that will be used to uniqely identify and compare rows. This option allows us to exactly show which rows are missing, extra and which are diffrent without ordering clause.
100
+
101
+
```sql
102
+
procedure join_by_username is
103
+
l_actual sys_refcursor;
104
+
l_expected sys_refcursor;
105
+
begin
106
+
open l_expected for select username, user_id from all_users
107
+
union all
108
+
select'TEST' username, -600 user_id from dual
109
+
order by1desc;
110
+
open l_actual for select username, user_id from all_users
0 commit comments