declare
v_empno emp.empno%type :=&empno;
type tableType is table of emp%rowtype index by binary_integer;
v_emp tableType;
begin
select * bulk collect into v_emp from emp where empno=v_empno;
if v_emp.count>0 then
dbms_output.put_line('查到此雇员');
if v_emp.deptno=30 then
dbms_output.put_line('此雇员属于SALES部门');
delete from emp where empno=v_empno;
else
dbms_output.put_line('此雇员不属于SALES部门,不能删除');
end if;
else
dbms_output.put_line('找不到此雇员');
end if;
end;
这个PL/SQL块 运行时提示 必须声明 'DEPTNO' 组件
实在不知道哪里出问题了
v_empno emp.empno%type :=&empno;
type tableType is table of emp%rowtype index by binary_integer;
v_emp tableType;
begin
select * bulk collect into v_emp from emp where empno=v_empno;
if v_emp.count>0 then
dbms_output.put_line('查到此雇员');
if v_emp.deptno=30 then
dbms_output.put_line('此雇员属于SALES部门');
delete from emp where empno=v_empno;
else
dbms_output.put_line('此雇员不属于SALES部门,不能删除');
end if;
else
dbms_output.put_line('找不到此雇员');
end if;
end;
这个PL/SQL块 运行时提示 必须声明 'DEPTNO' 组件
实在不知道哪里出问题了
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货