本帖最后由 XingOnline 于 2009-11-11 18:01:59 编辑

解决方案 »

  1.   

    返回cursor,sys_refcursor?
    定义一个sys_refcursor类型的游标变量,来传入远程过程的传出数据
    过程后面要加上@DBlinkName
    试试
      

  2.   

    试验了一下,以游标作为传出参数的存储过程在dblink中调用出错
    没找到解决办法
    关注下
      

  3.   

    没用过RefCursor传数据,但返回PL/SQL TABLE变量是没问题的。
    比如,在远端库有一个过程返回字符类型的pl/sql tablecreate type t_char is table of varchar2(128) index by pls_integer;create or replace proc_in_dblink (p_records out t_char) is
    begin
      select mycolumn
      bulk collect into p_records;
    end proc_in_dblink;在本地数据库,可以用一段pl/sql读取这个变量
    create type t_char is table of varchar2(128) index by pls_integer;set serveroutput on size 1000000
    declare
      v_records t_char;
    begin
      proc_in_dblink@mydblink(v_records);
      for i in 1 .. v_records.count loop
        dbms_output.put_line(v_records(i));
      end loop;
    end;
    /这种写法在8i中就支持,5、6年前我大量使用过。
      

  4.   

    本地数据库create or replace procedure procRefCursor
    is
    type cur is ref cursor;
    mycur cur;
    begin
      proc_in_dblink@mydblink( mycur);
          .....end procRefCursor;