Oracle列子跪求大神改错

qq_47941053 qq_47941053 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区

代码有错求大神改改

declare
    cursor cur_emp
    is select empno,ename,sal,deptno
    from emp;
BEGIN
    for emp_record in cur_emp
    loop
       if emp_record.deptno='SALESMAN' then
       update emp set sal =emp_record .sal where deptno=emp_record.deptno;
       dbms.output.put_line('员工编号:'||emp_record.empno||'员工姓名'||emp_record.ename||',所在部门编号:'||emp_record.deptno||,'原工资'||emp_record.sal||',调整后工资:'||emp_record.sal);
       else if emp_record.deptno='ANALYST' then
       update emp set sal =emp_record .sal where deptno=emp_record.deptno;
       dbms.output.put_line('员工编号:'||emp_record.empno||'员工姓名'||emp_record.ename||',所在部门编号:'||emp_record.deptno||,'原工资'||emp_record.sal||',调整后工资:'||emp_record.sal);
       else if emp_record.deptno='MANAGER' then
       update emp set sal =emp_record .sal where deptno=emp_record.deptno;
       dbms.output.put_line('员工编号:'||emp_record.empno||'员工姓名'||emp_record.ename||',所在部门编号:'||emp_record.deptno||,'原工资'||emp_record.sal||',调整后工资:'||emp_record.sal);
       else if emp_record.deptno='CLERK' then
       update emp set sal =emp_record .sal where deptno=emp_record.deptno;
       dbms.output.put_line('员工编号:'||emp_record.empno||'员工姓名'||emp_record.ename||',所在部门编号:'||emp_record.deptno||,'原工资'||emp_record.sal||',调整后工资:'||emp_record.sal);
       else if  emp_record.deptno='PRESIDENT' then
       update emp set sal =emp_record .sal where deptno=emp_record.deptno;
       dbms.output.put_line('员工编号:'||emp_record.empno||'员工姓名'||emp_record.ename||',所在部门编号:'||emp_record.deptno||,'原工资'||emp_record.sal||',调整后工资:'||emp_record.sal);
       end if;
     end loop;
 end;

ORA-06550: 第 10 行, 第 145 列: 
PLS-00103: 出现符号 ","在需要下列之一时:
 ( - + case mod
   new null <an identifier>
   <a double-quoted delimited-identifier> <a bind variable>
   continue avg count current max min prior sql stddev sum
   variance execute forall merge time timestamp interval date
   <a string literal with character set specification>
   <a number> <a single-quoted SQL string> pipe
   <一个带有字符集说明的可带引号的字符串文字>
   <一个可带引号的 SQL 字符串> purge
符号 "null" 
ORA-06550: 第 13 行, 第 145 列: 
PLS-00103: 出现符号 ","在需要下列之一时:
 ( - + case mod
   new null <an identifier>
   <a double-quoted delimited-identifier> <a bind variable>
   continue avg count current max min prior sql stddev sum
   variance execut
ORA-06550: 第 16 行, 第 145 列: 
PLS-00103: 出现符号 ","在需要下列之一时:
 ( - + case mod
   new null <an identifier>
   <a double-quoted delimited-identifier> <a bind variable>
   continue avg count current max min prior sql stddev sum
   variance execut
ORA-06550: 第 19 行, 第 145 列: 
PLS-00103: 出现符号 ","在需要下列之一时:
 ( - + case mod
   new null <an identifier>
   <a double-quoted delimited-identifier> <a bind variable>
   continue avg count current max min prior sql stddev sum
   variance execut
ORA-06550: 第 22 行, 第 143 列: 
PLS-00103: 出现符号 ","在需要下列之一时:
 ( - + case mod
   new null <an identifier>
   <a double-quoted delimited-identifier> <a bind variable>
   continue avg count current max min prior sql stddev sum
   variance execut
ORA-06550: 第 24 行, 第 10 列: 
PLS-00103: 出现符号 "LOOP"在需要下列之一时:
 if
 

 

...全文

相关推荐

评论 2
收藏 已收藏
分享
返回顶部
qq_47941053
基础和管理 17,377 成员 95,111 内容