!!过程那里有错那里有错???

shizhusz110 2008-02-28 09:55:11
CREATE OR REPLACE
procedure UpdateSHGL_CJ(
i_cjrq in date,
i_hm in varchar,
i_dqbh in number,
i_hmlb in char,
i_wxcj in number,
i_bdhf in number,
i_bdct in number,
i_bdgj in number,
i_yhl in number,
i_dlsbh_sb in number
)
as
declare
h1 number(10,2):=0.49;
s1 number(10,2):=0.41;
h2 number(10,2):=0.25;
s2 number(10,2):=0.25;
A1 number(10,2):=i_bdhf;
B1 number(10,2):=i_bdgj;
C1 number(10,2):=i_bdct;
D1 number(10,2):=i_yhl;
F1 int:=100000;
G1 int:=100;
I1 number(10,2):=0.05;
F2 int:=200000;
G2 int:=100;
I2 number(10,2):=0.10;
E1 int:=30;
E2 int:=60;
i_yfcj number(10,2):=0.00;
i_hmcj number(10,2):=0.00;
i_sbcj number(10,2):=0.00;
i_dlsbh number:=0;
i_sbdls number:=0;
i_hmcj number(10,2);
i_sbcj number(10,2);
total1 number(10,2):=A1+B1+C1;
total2 number(10,2):=i_bdct+(1/(3*B1));
total3 number(10,2):=(1-D1)*total1;
begin
---------------------------------------
select sum(dlsbh) into i_dlsbh from SHGL_CJQD where cjrq=i_cjrq;
select sum(dlsbh_sb) into i_sbdls from SHGL_CJQD where cjrq=i_cjrq;
-------------------------------------------
if i_hmlb='1' then
if (total2 >=E1) then
i_hmcj:=H1 * total3;
i_sbcj:=S1* total3;
end if;
else --2
if total1>=F2 then--2.1
if (total1 >= G2) then--2.1.1
i_hmcj:=(H2+I2)*total1;
i_sbcj:=S2*total1;
end if;
if (total2>=E2 and total<G2) or (i_dls=i_sbdls) then--2.1.2
i_hmcj:=H2*total1;
i_sbcj:=S2*total1;
end if;
end if;--end2.1
if total1>=F1 and total1<F2 then--2.2
if total1 >=G1 then--2.2.1
i_hmcj:= (H2+I1)*total1;
i_sbcj:=S2*total1;
end if;
if (total2>=E2 and total2<G1)or (i_dls=i_sbdls) then--2.2.2
i_hmcj:=H2 * total1;
i_sbcj:=S2*total1;
end if;
end if;--end2.2
if total1<F1 then--2.3
i_hmcj:=H2*total1;
i_sbcj:=S2*total1;
end if;--end2.3
end if;
--------------------------
if i_dls=i_sbdls then--3
i_yfcj:=i_hmcj+i_sbcj;
else
i_yfcj:=i_hmcj;
end if;
---------------------------------
update SHGL_CJQD
set
total=total1,
yfcj=i_yfcj,
hmcj=i_hmcj,
sbcj=i_sbcj
where hm=i_hm and cjrq=i_cjrq;
end;
end;
如果多了个begin,if条件怎么很多错误??少了没??但是as那里有错???
...全文
44 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
sasacat 2008-02-28
  • 打赏
  • 举报
回复
'I_HMCJ' 最多允许有一个声明

'I_SBCJ' 最多允许有一个声明

必须声明标识符 'TOTAL'

必须声明标识符 'I_DLS'
sasacat 2008-02-28
  • 打赏
  • 举报
回复
> = 中间不能有空格
sasacat 2008-02-28
  • 打赏
  • 举报
回复
把那个declare 和最后一个end去掉

17,377

社区成员

发帖
与我相关
我的任务
社区描述
Oracle 基础和管理
社区管理员
  • 基础和管理社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧