File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -26,9 +26,14 @@ create or replace type body ut_data_value_refcursor as
2626 end;
2727
2828 overriding member function to_string return varchar2 is
29+ l_result clob;
2930 begin
30- --TODO - implement a way to get data out of ref_cursor wothout loosing the cursor
31- return ut_utils.to_string(to_char(null));
31+ if self.value is not null then
32+ dbms_xmlgen.setMaxRows(self.value, 100);
33+ l_result := dbms_xmlgen.getxml(self.value);
34+ dbms_xmlgen.restartQuery(self.value);
35+ end if;
36+ return ut_utils.to_string(l_result);
3237 end;
3338
3439end;
Original file line number Diff line number Diff line change @@ -129,12 +129,14 @@ create or replace type body equal as
129129 l_expected ut_data_value_refcursor := treat(self.expected as ut_data_value_refcursor);
130130 l_actual ut_data_value_refcursor := treat(a_actual as ut_data_value_refcursor);
131131 begin
132- l_result :=
133- equal_with_nulls(
134- ( xmltype( dbms_sql.to_refcursor(l_expected.value) ).getClobVal
135- = xmltype( dbms_sql.to_refcursor(l_actual.value) ).getClobVal)
136- , a_actual
137- );
132+ if l_expected.value is not null and l_actual.value is not null then
133+ --fetch 1M rows max
134+ dbms_xmlgen.setMaxRows(l_expected.value, 1000000);
135+ dbms_xmlgen.setMaxRows(l_actual.value, 1000000);
136+ l_result := dbms_lob.compare( dbms_xmlgen.getxml(l_expected.value), dbms_xmlgen.getxml(l_actual.value) ) = 0;
137+ else
138+ l_result := equal_with_nulls( null, a_actual);
139+ end if;
138140 end;
139141 elsif self.expected is of (ut_data_value_timestamp) and a_actual is of (ut_data_value_timestamp) then
140142 declare
You can’t perform that action at this time.
0 commit comments