oracle 有没有人可以帮我解决下面提到的错误?

mrwjdhj3  于 12个月前  发布在  Oracle
关注(0)|答案(1)|浏览(123)

我遇到了这个Oracle PSQL错误ORA-06533

Declare
  type empidvarray is varray(6) of employees.id%type;
  empid_array empidvarray:=empidvarray();
  c_empid employees.id%type;
  i integer(2);
  counter number(2);
begin
  select count(*) into counter from employees;
  select id into c_empid from employees where id =1;
  empid_array.extend;
  empid_array(10):=c_empid; -- array is trying to assigning the value of uninitialized position 10.
end;

字符串
ORA-06532:下标超出限度ORA-06512:第11行
有人可以帮助解决PLSQL问题吗?
https://techytraining.com/forum/topic/plsql-exception/

yrdbyhpb

yrdbyhpb1#

Declare
type empno_arr is varray(100) of emp.empno%type;
empno_arry empno_arr:=empno_arr();
c_empno emp.empno%type;
counter number(10);
begin
select count(*) into counter from emp;
select empno into c_empno
          from emp 
           where empno =7369;
empno_arry.extend(10);--Need to provide the  length of extend array. Otherwise it will consider as  index 1
empno_arry(10):=c_empno; -- array is trying to assigning the value of uninitialized position 10.
end;

字符串

相关问题