I have 10 functions and each function returns a table from using dblinks.
The structure is like
function declare
.
.
.
begin
.
if
for i in ( select * from table@dblinks)
loop
i.
i.
i.
--return tble
pipe row(obj);
end loop;
end if;
--close dblink statement..
execute immediate 'ALTER SESSION CLOSE DATABASE LINK TEST_LINK';
end;
All functions are like this only .
I tried rollback and commit inside before closing db link but it returns an error as:
ORA-14552: cannot perform a DDL, commit or rollback inside a query or DML
I want to close the dblink.
I think the problem is related to cursors, which were not properly closed. How to close these types of anonymous explicit cursors?