简体   繁体   中英

MAXIMUM CURSORS EXCEEDING WITH DATABASE LINK IN ORACLE

I have a stored procedure as follows, When I am executing ths procedure, every time 1 cursor increasing in remote server. How to Solve this.

create or replace function transactionaldatarecovery
   (i_tablename in varchar2) 
return varchar2 
as
    v_Num Number(3):=0; 
    v_SQLStmt Varchar2(2000);
    ret_status Varchar2(100);

begin

              v_sqlstmt := 'insert into '||i_tablename||
                           ' select *  from '||i_tablename||'@RECY_DBLINK a '||
                           ' where  not exists( select 1 '||
                           '                    from   '||i_tablename||' b'||
                           '                    where  B.sno = A.sno' ;

        Execute immediate v_SQLstmt;

return 'Success';
end transactionaldatarecovery;

Do you commit after running the function? It should free opened cursor on remote DB.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM