Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b8dc2a6

Browse files
committed
Output-Buffer no longer deletes contents during init
This is for we need to re-instantiate the Output-Buffer from java-api. If we provide an output_id it should just "append" to the existing output-buffer.
1 parent 7fde523 commit b8dc2a6

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

source/core/output_buffers/ut_output_table_buffer.tpb

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,14 @@ create or replace type body ut_output_table_buffer is
2727

2828
overriding member procedure init(self in out nocopy ut_output_table_buffer) is
2929
pragma autonomous_transaction;
30+
l_exists int;
3031
begin
31-
delete from ut_output_buffer_tmp where output_id = self.output_id;
32-
delete from ut_output_buffer_info_tmp where output_id = self.output_id;
33-
insert into ut_output_buffer_info_tmp(output_id, start_date) values (self.output_id, self.start_date);
32+
select count(*) into l_exists from ut_output_buffer_info_tmp where output_id = self.output_id;
33+
if ( l_exists > 0 ) then
34+
update ut_output_buffer_info_tmp set start_date = self.start_date where output_id = self.output_id;
35+
else
36+
insert into ut_output_buffer_info_tmp(output_id, start_date) values (self.output_id, self.start_date);
37+
end if;
3438
commit;
3539
end;
3640

0 commit comments

Comments
 (0)