具体代码:
procedure sp_wms_synProSeries is
      --cursor ps_cur is  select xlbm,xlmc from jc_spxl ps;
      cursor ps_cur is  select xlbm,xlmc from yxsys.jc_spxl@HD_MIDDLEDB ps;      v_count       number;
    begin
      for cur in ps_cur loop
        select count(1) into v_count from wms_pub_productseries ps
        where ps.productseriescode=cur.xlbm;
        if v_count>0 then       --有相同编码,名称等是否会发生变化,如果不发生,则不用修改,与接口方讨论决定。
          update wms_pub_productseries ps set ps.productseriesname=cur.xlmc
          where ps.productseriescode=cur.xlbm;
        else                    --无相同编码,插入本地数据库
          insert into wms_pub_productseries(id,productseriescode,productseriesname,
          state,isimport,re) values(pack_wms_pub.fu_wms_getTableFieldId(),cur.xlbm,
          cur.xlmc,'1','1','从营销系统导入生成');
        end if;
      end loop;
EXCEPTION
.............
编译时出现的异常如下:
Compilation errors for PACKAGE BODY HUIKE.PACK_WMS_TYYCEXTError: PL/SQL: ORA-04052: error occurred when looking up remote object YXSYS.JC_SPXL@HD_MIDDLEDB
       ORA-00604: error occurred at recursive SQL level 1
       ORA-02020: too many database links in use
Line: 9
Text: cursor ps_cur is  select xlbm,xlmc from yxsys.jc_spxl@HD_MIDDLEDB ps;Error: PL/SQL: SQL Statement ignored
Line: 9
Text: cursor ps_cur is  select xlbm,xlmc from yxsys.jc_spxl@HD_MIDDLEDB ps;Error: PLS-00364: loop index variable 'CUR' use is invalid
Line: 14
Text: where ps.productseriescode=cur.xlbm;Error: PL/SQL: ORA-00904: "CUR"."XLBM": invalid identifier
Line: 14
Text: where ps.productseriescode=cur.xlbm;Error: PL/SQL: SQL Statement ignored
Line: 13
Text: select count(1) into v_count from wms_pub_productseries psError: PLS-00364: loop index variable 'CUR' use is invalid
Line: 17
Text: where ps.productseriescode=cur.xlbm;Error: PL/SQL: ORA-00904: "CUR"."XLBM": invalid identifier
Line: 17
Text: where ps.productseriescode=cur.xlbm;Error: PL/SQL: SQL Statement ignored
Line: 16
Text: update wms_pub_productseries ps set ps.productseriesname=cur.xlmcError: PLS-00364: loop index variable 'CUR' use is invalid
Line: 21
Text: cur.xlmc,'1','1','从营销系统导入生成');Error: PL/SQL: ORA-00984: column not allowed here
Line: 21
Text: cur.xlmc,'1','1','从营销系统导入生成');Error: PL/SQL: SQL Statement ignored
Line: 19
Text: insert into wms_pub_productseries(id,productseriescode,productseriesname,在网上找了修改open_links参数方法,我把原来的4改为20,但还是不行。是不是我这个会话打开的数据库链接数太多了?我怎样能知道这个会话到底打开了多少数据库链接呢?还有什么办法能解决这个异常?