首先执行存储过程,插入数据到临时表(不能提交,会锁表)
DECLARE A VARCHAR(20);
BEGIN
PG_BAD_BUSINESS.P_BAD_BUSINESS_DISPOSE('50D56905','LJ',A);
dbms_output.put_line(a);
END ;
查询临时表被拦截的行
select t1.goodsid,t1.goodsbatch,t1.companyid,t1.qualityflg,t1.applynum,t2.outstock_num
from outstockinformdttbl t1
left join (select outstockindicationid,outstockindicationdtid,goodsid,goodsbatch,qualityflg,sum( outstock_num) outstock_num
from (select a.outstockindicationid,a.outstockindicationdtid,a.goodsid,a.goodsbatch,a.qualityflg,a.outstock_num
from TEMP_REPSTOCKGOODS_RESULT a
union all
select a.outstockindicationid,a.outstockindicationdtid,a.goodsid,a.goodsbatch,a.qualityflg,nvl(a.outstock_num_big,0)*nvl(a.bigpernum,0)
from TEMP_REPSTOCKGOODS_RESULT_BIG a)
group by outstockindicationid,outstockindicationdtid,goodsid,goodsbatch,qualityflg) t2 on t1.outstockinformid = t2.outstockindicationid
and t1.outstockinformdtid = t2.outstockindicationdtid
where --t1.applynum != t2.outstock_num;
t1.outstockinformid = '50D56905'--2019-03-12
AND t1.applynum != nvl(t2.outstock_num,0);--2019-03-05
文档更新时间: 2024-03-25 13:34 作者:周骏