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/expectations.md
+96Lines changed: 96 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -445,6 +445,8 @@ utPLSQL is capable of comparing compound data-types including:
445
445
- Cursors, nested table and varray types are compared as **ordered lists of elements**. If order of elements differ, expectation will fail.
446
446
- Comparison of compound data is data-type aware. So a column `ID NUMBER` in a cursor is not the same as `ID VARCHAR2(100)`, even if they both hold the same numeric values.
447
447
- Comparison of cursor columns containing `DATE` will only compare date part **and ignore time** by default. See [Comparing cursor data containing DATE fields](#comparing-cursor-data-containing-date-fields) to check how to enable date-time comparison in cursors.
448
+
- Comparison of cursor returning `TIMESTAMP`**columns** against cursor returning `TIMESTAMP`**bind variables** requires variables to be casted to proper precision. This is an Oracle SQL - PLSQL compatibility issue and usage of CAST is the only known workaround for now.
449
+
See [Comparing cursor data containing TIMESTAMP bind variables](#comparing-cursor-data-containing-timestamp-bind-variables) for examples.
448
450
- To compare nested table/varray type you need to convert it to `anydata` by using `anydata.convertCollection()`
449
451
- To compare object type you need to convert it to `anydata` by using `anydata.convertObject()`
450
452
- It is possible to compare PL/SQL records, collections, varrays and associative arrays. To compare this types of data, use cursor comparison feature of utPLSQL and TABLE operator in SQL query
@@ -749,6 +751,100 @@ In the above example:
749
751
- The test `get_events_for_date_range` will succeed, as the `l_expected_bad_date` cursor contains different date-time then the cursor returned by `get_events` function call.
750
752
- The test `bad_test` will fail, as the column `event_date` will get compared as DATE without TIME.
751
753
754
+
### Comparing cursor data containing TIMESTAMP bind variables
755
+
756
+
To properly compare `timestamp` column data returned by cursor against bind variable data from another cursor, a conversion needs to be done.
757
+
758
+
This applies to `timestamp`,`timestamp with timezone`, `timestamp with local timezone` data types.
759
+
760
+
Example below illustrates usage of `cast` operator to assure appropriate precision is applied on timestamp bind-variables in cursor result-set
0 commit comments