@@ -972,18 +972,21 @@ Rows: [ 4 differences ]
972972 procedure reports_on_exception_in_cursor
973973 as
974974 l_actual sys_refcursor;
975- l_error_code integer := -19202; --Error occurred in XML processing
975+ l_expected_message varchar2(32767);
976+ l_actual_message varchar2(32767);
976977 begin
977978 --Act
978979 open l_actual for select 1/0 as error_column from dual connect by level < 10;
979- begin
980980 ut3.ut.expect(l_actual).to_be_empty();
981981 --Assert
982- ut.fail('Expected '||l_error_code||' but nothing was raised');
983- exception
984- when others then
985- ut.expect(sqlcode).to_equal(l_error_code);
986- end;
982+ --Assert
983+ l_expected_message := q'[%SQL exception thrown when fetching data from cursor:%
984+ %ORA-01476: divisor is equal to zero%
985+ %Check the query and data for errors.]';
986+
987+ l_actual_message := ut3.ut_expectation_processor.get_failed_expectations()(1).message;
988+ --Assert
989+ ut.expect(l_actual_message).to_be_like(l_expected_message);
987990 end;
988991
989992 procedure exception_when_closed_cursor
@@ -2481,15 +2484,9 @@ Diff:%
24812484
24822485 ut3.ut.expect(v_actual).to_equal(v_expected);
24832486 --Assert
2484- l_expected_message := q'[%Failed to process ref_cursor with error
2485- %ORA-01722: invalid number
2486- %Actual: refcursor [ count = ] was expected to equal: refcursor [ count = 1 ]
2487- %Diff:
2488- %Columns:
2489- %Column <USD_PRICE_AMT> [data-type: NUMBER] is missing. Expected column position: 1.
2490- %Column <UPDATE_ID> [data-type: VARCHAR2] is missing. Expected column position: 2.
2491- %Rows: [ 1 differences ]
2492- %Row No. 1 - Missing: <USD_PRICE_AMT>1357</USD_PRICE_AMT><UPDATE_ID>TEST_USER</UPDATE_ID>]';
2487+ l_expected_message := q'[%SQL exception thrown when fetching data from cursor:%
2488+ %ORA-01722: invalid number%
2489+ %Check the query and data for errors.]';
24932490
24942491 l_actual_message := ut3.ut_expectation_processor.get_failed_expectations()(1).message;
24952492 --Assert
@@ -2512,15 +2509,9 @@ Diff:%
25122509
25132510 ut3.ut.expect(v_actual).to_equal(v_expected);
25142511 --Assert
2515- l_expected_message := q'[%Failed to process ref_cursor with error
2516- %ORA-01722: invalid number
2517- %Actual: refcursor [ count = 1 ] was expected to equal: refcursor [ count = ]
2518- %Diff:
2519- %Columns:
2520- %Column <USD_PRICE_AMT> [data-type: NUMBER] is missing. Expected column position: 1.
2521- %Column <UPDATE_ID> [data-type: VARCHAR2] is missing. Expected column position: 2.
2522- %Rows: [ 1 differences ]
2523- %Row No. 1 - Extra: <USD_PRICE_AMT>1357</USD_PRICE_AMT><UPDATE_ID>TEST_USER</UPDATE_ID>]';
2512+ l_expected_message := q'[%SQL exception thrown when fetching data from cursor:%
2513+ %ORA-01722: invalid number%
2514+ %Check the query and data for errors.]';
25242515
25252516 l_actual_message := ut3.ut_expectation_processor.get_failed_expectations()(1).message;
25262517 --Assert
@@ -2544,15 +2535,9 @@ Diff:%
25442535
25452536 ut3.ut.expect(v_actual).to_equal(v_expected);
25462537 --Assert
2547- l_expected_message := q'[%Failed to process ref_cursor with error
2548- %ORA-01722: invalid number
2549- %Actual: refcursor [ count = 1 ] was expected to equal: refcursor [ count = ]
2550- %Diff:
2551- %Columns:
2552- %Column <USD_PRICE_AMT> [data-type: NUMBER] is missing. Expected column position: 1.
2553- %Column <UPDATE_ID> [data-type: VARCHAR2] is missing. Expected column position: 2.
2554- %Rows: [ 1 differences ]
2555- %Row No. 1 - Extra: <USD_PRICE_AMT>1357</USD_PRICE_AMT><UPDATE_ID>TEST_USER</UPDATE_ID>]';
2538+ l_expected_message := q'[%SQL exception thrown when fetching data from cursor:%
2539+ %ORA-01722: invalid number%
2540+ %Check the query and data for errors.]';
25562541
25572542 l_actual_message := ut3.ut_expectation_processor.get_failed_expectations()(1).message;
25582543 --Assert
0 commit comments