如下我写了一个包头,但是当我加上第4行的关联数组定义时,就显示
“PACKAGE salpkg 已编译
Warning: 执行完毕, 但带有警告”
为什么呢?
---------------------------------------------------------------
create or replace package salpkg as
  type deptsal_rec is record(deptno emp.deptno%type, sal emp.sal%type);
  type deptsalset is table of deptsal_rec;
  type dept_maxsalset is table of emp.sal%type index by emp.deptno%type;
  procedure emp_group_maxsal(deptsal in deptsalset);
end salpkg;
/

解决方案 »

  1.   

    看你代码没什么问题啊 
    你的报什么错误?
    在SQLPLUS下show error 看看具体什么错误信息再说
      

  2.   

    或许是这句话的原因:
    type dept_maxsalset is table of emp.sal%type index by emp.deptno%type;
      

  3.   

    运行的结果:行 4 上出现错误: PL/SQL: Declaration ignored
    ---------------------------------------------
    我不知道这句话为什么错了??
    type dept_maxsalset is table of emp.sal%type index by emp.deptno%type;
      

  4.   

    这里emp.sal和emp.deptno都是number类型,我想关联数组应该可以这样来定义吧,问题到底出在哪里?
    求助~~~~(>_<)~~~~ 
      

  5.   

    什么意思?是index by后面的数据类型不对吗?
      

  6.   

    终于找到原因了,原来index by后面只能是BINARY_INTEGER、PLS_INTEGER、VARCHAR2这几种类型啊
    谢谢各位的回复~~~~~