小弟新手,写了个存储过程,但总有错,请大家帮忙改下,
万分感谢!!!
(postid in number,somid in char(14),
balancemoney out number)
as
somid_c number;
counter number;
begin
select childcount into conuter from system.hr_gatheringbill where somid=somid;
if (counter>0) then
select balancemoney from system.hr_gatheringregion
where postid in
( select max(postid)
from system.hr_gatheringregion
); ---输出balancemoney值
else (counter=0)
begin
select count(somid) into somid_c from system.hr_gatheringregion
where somid=somid;
if (somid_c=1) then
select balancemoney from system.hr_gatheringregion
where primaryid=(select somid from system.hr_gatheringbill
where createtime in
( select max(createtime)
from system.hr_gatheringbill
)
); ---输出balancemoney值
else (somid_c=0)
balancemoney=0; ---输出balancemoney=0
end if;
end;
end if;
end;
万分感谢!!!
(postid in number,somid in char(14),
balancemoney out number)
as
somid_c number;
counter number;
begin
select childcount into conuter from system.hr_gatheringbill where somid=somid;
if (counter>0) then
select balancemoney from system.hr_gatheringregion
where postid in
( select max(postid)
from system.hr_gatheringregion
); ---输出balancemoney值
else (counter=0)
begin
select count(somid) into somid_c from system.hr_gatheringregion
where somid=somid;
if (somid_c=1) then
select balancemoney from system.hr_gatheringregion
where primaryid=(select somid from system.hr_gatheringbill
where createtime in
( select max(createtime)
from system.hr_gatheringbill
)
); ---输出balancemoney值
else (somid_c=0)
balancemoney=0; ---输出balancemoney=0
end if;
end;
end if;
end;
解决方案 »
- ++++++在java中调用存储过程出错,跪求解决方案?+++++++
- 关于建立异地数据库的视图
- 今天发现原来录入的数据全都没有了,提示ntos-2011:无法显示带有LOB,RAW,LONG RAW和OBJECT类型列的表的内容
- 紧急求救:oracle9i系统管理员密码没了
- 小问题:安装9i
- 安装9i时出现的一个怪问题!!
- ORACLE的服务都启动了,可连数据库时发生"oracle not available"
- 一个关于Oracle视图的问题(着急,上火!)
- oracle关于日期的比较问题,急!
- 关于Oracle Listener的问题
- PL/SQL中,主函数中使用BEGIN...EXCEPTION...END模块的效率问题。听听大家的意见
- 如何给时间字段增加15分钟?
变量名称不要跟字段名称冲突!
else (counter=0)换成elsif(counter=0)试试
------------------
这是永真式 应该查出多条记录,这时select into 会抛异常