返回一个varchar2的信息不就可以了。''就是没有错误,<>''就是错误说明。
解决方案 »
- window如何访问linux下oracle数据库?
- 如何把在powerdesigner设计好的关系表导入到oracle?
- ORA-12560和ORA-12154错误
- 小问题 关于oracle的随机查询问题
- 在Linux AS3 安装 Oracle 9.2.0.4
- 请教问题,急,在线等!谢谢
- ORA-04091 USER.TABLE 发生了变化,触发器/函数不能读
- 表复制时,如果源表有字段的类型是LONG RAW ,复制失败,如何解决?
- 为什么通过DBA STUDIO启动不了数据库?
- 关于连表更新
- 备份一个几百万行的表,用什么方法最快?
- 不知道数据库密码,但可以在应用程序里备份数据库,能在其他数据库导入吗?急
return number is
result number;
v_count number;
begin
select count(1)
into v_count
from sb_jbyxsj_lr
where sycj = v_sycj and rq = to_date(v_frontrq,'yyyy-mm-dd');
if v_count > 0 then
-- 有前一天的数据,修改累计时间、本次累计时间
update sb_jbyxsj_lr a
set a.ljsj = a.yxsj +
( select b.ljsj from sb_jbyxsj_lr b
where a.sbbh = b.sbbh and b.sycj = v_sycj and
b.rq = to_date(v_frontrq,'yyyy-mm-dd') ),
a.bclj = a.yxsj +
( select b.bclj from sb_jbyxsj_lr b
where a.sbbh = b.sbbh and b.sycj = v_sycj and
b.rq = to_date(v_frontrq,'yyyy-mm-dd') )
where a.sycj = v_sycj and a.rq = to_date(v_rq,'yyyy-mm-dd') and
a.sbbh in ( select c.sbbh from sb_jbyxsj_lr c
where a.sbbh = c.sbbh and c.sycj = v_sycj and
c.rq = to_date(v_frontrq,'yyyy-mm-dd') );
elsif
-- 没有前一天的数据
update sb_jbyxsj_lr
set ljsj = ljsj + yxsj,
bclj = bclj + yxsj
where sycj = v_sycj and rq = to_date(v_rq,'yyyy-mm-dd');
end if; commit;
--这里是增加部分 p_out:='执行成功!';
exception
when others then
rollback;
p_out:='执行失败!';
end;
update sb_jbyxsj_lr a
set a.ljsj = a.yxsj +
( select b.ljsj from sb_jbyxsj_lr b
where a.sbbh = b.sbbh and b.sycj = v_sycj and
b.rq = to_date(v_frontrq,'yyyy-mm-dd') ),
a.bclj = a.yxsj +
( select b.bclj from sb_jbyxsj_lr b
where a.sbbh = b.sbbh and b.sycj = v_sycj and
b.rq = to_date(v_frontrq,'yyyy-mm-dd') )
where a.sycj = v_sycj and a.rq = to_date(v_rq,'yyyy-mm-dd') and
a.sbbh in ( select c.sbbh from sb_jbyxsj_lr c
where a.sbbh = c.sbbh and c.sycj = v_sycj and
c.rq = to_date(v_frontrq,'yyyy-mm-dd') );
这个语句因起的。