my_table2在你的过程中是一个类型,而不是一个变量。就像你定义一个字符串,可以用varchar类型的变量a,而不能直接用varchar拿去传参

解决方案 »

  1.   

    用这个类型,重新定义变量,下面都使用变量应该就可以了
    declare
        type my_record2 is record is(
        id employee.id%type,
        name employee.name%type,
        salary employee.salary%type,
     );
     type my_table2 is table of my_record2 index by binary_integer; 
     v_table  my_table2;
    begin
        my_package.p_rec(v_table);end;
      

  2.   


    那是我在家里电脑敲错了,少了一句
    t2  my_table2 ; type my_table2 is table of my_record2 index by binary_integer; 
    begin
        my_package.p_rec(t2 );
    end;我在公司电脑的是这样的
      

  3.   


    我在公司电脑的是这样的 ,涅磐重生NPCS 你可以试试,会报错的,
      

  4.   

    declare
        type my_record2 is record is(
        id employee.id%type,
        name employee.name%type,
        salary employee.salary%type,
     );
     type my_table2 is table of my_record2 index by binary_integer; 
     t2  my_table2 
    begin
        my_package.p_rec(t2);
    end;
    我在公司电脑的是这样的, 
      

  5.   

    如果行不通的话,建议你用ref游标或者先建立type对象来实现
      

  6.   

    这里贴出来的代码到处是错误,又说真实代码不是这样。这是让别人帮忙找问题呢,还是误导
    你要别人认真帮你,提问同样不要含糊包里定义的存储过程的传入参数那里,要求的类型是my_table
    而执行的时候,传入的参数类型是my_table2 。虽然实际上是一样的,但属于不同的类型
    因此执行的时候,不应该再去定义一个my_table2,而是直接定义:
     t2  my_package.my_table;