有匿名语句块如下
declare
v_max emp.sal%type ;
v_min emp.sal%type ;
v_sal emp.sal%type ;
v_deptno dept.deptno%type;
begin
select deptno into v_deptno from dept where dname='RESEARCH';
select max(sal) into v_max from emp where deptno = v_deptno;
select min(sal) into v_min from emp where deptno = v_deptno;
select sal into v_sal from emp where ename = 'ALLEN';
update emp set deptno = v_deptno where ename = 'ALLEN';
If (v_sal < v_min) then
update emp set sal = v_min where ename = 'ALLEN';
Elseif (v_sal > v_max) then
update emp set sal = v_max where ename = 'ALLEN';
End If;
end;执行的时候报错PLS-00103:Encountered the symbol "THEN" when expecting one of the following :=.(%;
就是在 Elseif (v_sal > v_max) then
小弟我看了半天,我也没看出来是哪里错了..请高手指教一下小弟
declare
v_max emp.sal%type ;
v_min emp.sal%type ;
v_sal emp.sal%type ;
v_deptno dept.deptno%type;
begin
select deptno into v_deptno from dept where dname='RESEARCH';
select max(sal) into v_max from emp where deptno = v_deptno;
select min(sal) into v_min from emp where deptno = v_deptno;
select sal into v_sal from emp where ename = 'ALLEN';
update emp set deptno = v_deptno where ename = 'ALLEN';
If (v_sal < v_min) then
update emp set sal = v_min where ename = 'ALLEN';
Elseif (v_sal > v_max) then
update emp set sal = v_max where ename = 'ALLEN';
End If;
end;执行的时候报错PLS-00103:Encountered the symbol "THEN" when expecting one of the following :=.(%;
就是在 Elseif (v_sal > v_max) then
小弟我看了半天,我也没看出来是哪里错了..请高手指教一下小弟
解决方案 »
- 启动OracleBIPresentat 服务的问题
- oracle 11g 官方下载不了,为什么?
- 救救我,求一sql
- 请教sqlserver移植到oracle的问题
- Oracle存储过程的例子,把例子运行一遍,你会学到点东西哈!快乐就好!我刚边学边写的。
- 請問,如何取的一個日期的下個月的月份?
- ORACLE的sql plus 查询结果存入一个文件的问题?急!!!
- 数据库导入中字符集不同的问题
- 在一个表空间中创建1000个以上的表oracle吃的消吗?
- 请教sql语句,如何用like关联两个表中的字段,将查询结果的部分内容提取出来?
- 急!求助 简单
- oracle isnumber to_number 返回值
多了一个e
如果使用PL.SQL.Developer开发工具,颜色为变化的