请问我这段代码到底有什么问题,看不懂啊?怎么修改呢。
我这单代码的题目是用动态游标
输入部门编号后会输出员工姓名和工资
代码
declare
type dongtai is ref cursor;
m dongtai;
v_emp emp%rowtype;
v_deptno int := &请输入部门编号;
cnt int;
begin
select count(1) cnt from emp where deptno=v_deptno;
if cnt >0 then
open m for select * from emp where deptno=v_deptno;
loop
fetch m into v_emp;
exit when m%notfoud;
dbms_output.put_line(v_emp.ename||'-'||v_emp.sal);
end loop;
close m;
end if;
end;
提示的错信息:
ORA-06550: line 5, column 18:
PLS-00103: Encountered the symbol "&" when expecting one of the following:
( - + case mod new not null
continue avg count current exists max min prior sql stddev
sum variance execute forall merge time timestamp interval