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
+48-5Lines changed: 48 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ utPLSQL expectations incorporates advanced data comparison options when comparin
7
7
- nested table and varray
8
8
9
9
Advanced data-comparison options are available for the [`equal`](expectations.md#equal) matcher.
10
-
10
+
11
11
## Syntax
12
12
13
13
```
@@ -58,7 +58,7 @@ Columns 'ignore_me' and "ADate" will get excluded from cursor comparison.
58
58
The cursor data is equal, when those columns are excluded.
59
59
60
60
This option is useful in scenarios, when you need to exclude incomparable/unpredictable column data like CREATE_DATE of a record that is maintained by default value on a table column.
61
-
61
+
62
62
## Selecting columns for data comparison
63
63
64
64
Consider the following example
@@ -95,8 +95,51 @@ Only the columns 'RN', "A_Column" will be compared. Column 'SOME_COL' is exclude
95
95
96
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.
97
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.
98
+
##Unordered
99
+
100
+
Unordered option allows for quick comparison of two cursors without need of ordering them in any way.
101
+
102
+
Result of such comparison will be limited to only information about row existing or not existing in given set without actual information about exact differences.
103
+
104
+
105
+
106
+
```sql
107
+
procedure unordered_tst is
108
+
l_actual sys_refcursor;
109
+
l_expected sys_refcursor;
110
+
begin
111
+
open l_expected for select username, user_id from all_users
112
+
union all
113
+
select'TEST' username, -600 user_id from dual
114
+
order by1desc;
115
+
open l_actual for select username, user_id from all_users
You can now join two cursors by defining a primary key or composite key that will be used to uniquely identify and compare rows. This option allows us to exactly show which rows are missing, extra and which are different without ordering clause.
100
143
101
144
```sql
102
145
procedure join_by_username is
@@ -133,4 +176,4 @@ begin
133
176
open l_actual for select rownum as rn, 'a'as"A_Column", 'x' SOME_COL, a.*from all_objects a where rownum <4;
0 commit comments