首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >ORA-00936:缺少表达式错误

ORA-00936:缺少表达式错误
EN

Stack Overflow用户
提问于 2017-10-06 04:27:15
回答 1查看 220关注 0票数 0

我正在收到的错误:在这里输入图像描述

在过程中的“插入”语句上抛出错误。目标表具有与insert语句相同的列数和数据类型。

我的程序是:

代码语言:javascript
复制
create or replace procedure updatetax
is
date_30 date:=sysdate-(365*30);
date_50 date:=sysdate-(365*50);
/*employees less than 30 years of age*/
cursor c1 is
select eid
from employee 
where dateofbirth>date_30
and enddate is null;
/*employees between the age of 30 and 50*/
cursor c2 is
select eid
from employee
where dateofbirth between date_50 and date_30;
/*employees greater than 50 years of age*/
cursor c3 is
select eid
from employee
where dateofbirth<date_50;
r1 employee.eid%type;
r2 employee.eid%type;
r3 employee.eid%type;
begin
  open c1;
  for r1 in c1
  loop
    insert into emptax
    values(r1.eid,gettaxlessthan30(select salary from empsalary where eid=r1.eid),sysdate);
  end loop;
  close c1;
  commit;
  open c2;
  for r2 in c2
  loop
    insert into emptax
    values(r2.eid,gettaxbetween30and50(select salary from empsalary where eid=r2.eid),sysdate);
  end loop;
  commit;
  open c3;
  close c2;
  for r3 in c3
  loop
    insert into emptax
    values(r3.eid,gettaxgreaterthan50(select salary from empsalary where eid=r3.eid),sysdate);
  end loop;
  commit;
  close c3;
end;
/

存储过程中调用的函数具有以下逻辑:

代码语言:javascript
复制
create or replace function gettaxlessthan30(esalary_in number)
return number
is
  tax_out number(10,2);
begin
  tax_out:=0.07*esalary_in;
  return tax_out;  
end;
/
EN

回答 1

Stack Overflow用户

发布于 2017-10-07 16:43:13

解决了-重新重写程序从一开始,它工作得很好。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/46598279

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档