日期:2014-05-17  浏览次数:21047 次

写了个存储过程,怎么有时能insert(插入)10条值,有时只能插入5条值呢?
SQL code

create or replace procedure P_Task_order
IS
Begin
  insert into REPORT(a,b,c,d,e,f,g,h,i,j,k,
         l,m,n,o,p,q,r,s)
  select * from t1, t2, t3 where t1.a =1 and t1.b = t2.b(+)
         and t2.c = t3.c;

  commit;

  exception
    when others then
    rollback;
End;



sql如上

------解决方案--------------------
是不是表里数据的问题,检查一下?
------解决方案--------------------
1、查看select * from t1, t2, t3 where t1.a =1 and t1.b = t2.b(+)
and t2.c = t3.c 出来的结果集数量
2、exception
when others then
rollback;
给返回个错误,看看是啥内容
------解决方案--------------------
中间遇到null值了?
------解决方案--------------------
检查selec中的结果集,是多少就是多少。
------解决方案--------------------
SQL code

select * from t1, t2, t3 where t1.a =1 and t1.b = t2.b(+)
         and t2.c = t3.c;
--这段SELECT结果集,是不是有问题?