执行这个存储过程,SQLCA.SQLCODE=100

yjq777 2012-04-17 08:59:05
有三个表分别是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,请问哪里有问题呢?
...全文
283 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
茫茫前路 2012-04-18
  • 打赏
  • 举报
回复
ls_gh = dw_1.getitemstring(ll_row , 'gh')
楼主有没有看看这个ls_gh的值是否NULL值啊
baiynije 2012-04-18
  • 打赏
  • 举报
回复
此處sqlcode值只表示是否成功執行此存儲過程,并不代表存儲過程內部已成功執行刪除動作。
DYFDWX 2012-04-18
  • 打赏
  • 举报
回复
对的
if sqlca.sqlcode0 or sqlca.sqlcode=100 then
commit;
else
rollback;
end if
yjq777 2012-04-18
  • 打赏
  • 举报
回复
这三个表中都有相应的数据,但是就是通过这个存储过程删除不了。
yjq777 2012-04-18
  • 打赏
  • 举报
回复
谢谢3楼的,你的对!
yjq777 2012-04-18
  • 打赏
  • 举报
回复
这个值我考虑过,不是NULL的
A啦Dbit 2012-04-17
  • 打赏
  • 举报
回复
意思是无数据影响

754

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder 数据库相关
社区管理员
  • 数据库相关社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧