declare
  v_sal emp.sal%type;
begin
  select sal into v_sal from emp where empno = 7369;
  if (v_sal < 1200) then
    dbms_output.put_line('low');
  elseif (v_sal < 2000) then
    dbms_output.put_line('middle');
  else
    dbms_output.put_line('high');
  end if;
end;
第 7 行出现错误:
ORA-06550: 第 7 行, 第 25 列:
PLS-00103: 出现符号 "THEN"在需要下列之一时:
:= . ( % ;
ORA-06550: 第 9 行, 第 3 列:
PLS-00103: 出现符号 "ELSE"在需要下列之一时:
( begin case declare end
exit for goto if loop mod null pragma raise return select
update when while with <an identifier>
<a double-quoted delimited-identifier> <a bind variable> <<
ORA-06550: 第 12 行, 第 1 列:
PLS-00103: 出现符号 "END"我好纠结啊,这么简单的一个小程序。也可能是我的电脑,或者oracle的问题把,大家在你的电脑上运行看看,谢谢啦!!!

解决方案 »

  1.   

    pl/sql 的elseif 改为elsif
      

  2.   

    Oh, my god!!!!!!!   就这么简单啊,我刚刚在看教学视频,擦亮双眼,愣是瞪了好久都没找出这个区别,只知道老师说,elsif不是我们常用的else if,中间没有空格,就是没看到中间还少了一个e.在谷歌上面也没有找到答案,我还以为遇到了史无前例的问题呢,,,哈哈哈!!!!原来这么白痴啊!!!!!太感谢你了...