当前位置: 代码迷 >> PB >> 执行这个存储过程,SQLCA.SQLCODE=100解决办法
  详细解决方案

执行这个存储过程,SQLCA.SQLCODE=100解决办法

热度:260   发布时间:2016-04-29 08:21:24.0
执行这个存储过程,SQLCA.SQLCODE=100
有三个表分别是a,b,c

CREATE procedure del_a_b_c

@ls_temgh varchar(3)

as 

begin
   
  delete from a where gh = @ls_temgh
  delete from b where gh = @ls_temgh
  delete from c where gh = @ls_temgh

end
GO
ls_gh = dw_1.getitemstring(ll_row , 'gh')
declare sp_del_a_b_c procedure for del_a_b_c
  @ls_temgh = :ls_gh ;
  execute sp_del_a_b_c;
if sqlca.sqlcode = 0 then
commit;
else
messagebox('' , sqlca.sqlcode)
rollback;
end if

结果sqlca.sqlcode返回值为100,请问哪里有问题呢?

------解决方案--------------------
对的
if sqlca.sqlcode0 or sqlca.sqlcode=100 then
commit;
else
rollback;
end if
------解决方案--------------------
此處sqlcode值只表示是否成功執行此存儲過程,并不代表存儲過程內部已成功執行刪除動作。
  相关解决方案