当前位置: 代码迷 >> PB >> POWERBUILDER11.5调用sqlserver2000带输出参数存储过程出错,咋回事
  详细解决方案

POWERBUILDER11.5调用sqlserver2000带输出参数存储过程出错,咋回事

热度:59   发布时间:2016-04-29 08:52:31.0
POWERBUILDER11.5调用sqlserver2000带输出参数存储过程出错,怎么回事?
powerbuilder11.5
sqlserver2000
数据库连接方式:SNC SQL Native Client(OLE DB)
语句如下:
DECLARE my_getid procedure for sp_GetID
@RemoteId = "00",@cAcc_Id = :ls_acc,@cVouchType = "SK",@iAmount = 1,@iFatherId =:ll_fid output,@iChildId = :ll_cid output using jiekou_yu ;
EXECUTE my_getid ;
fetch my_getid into :ll_fid,:ll_cid ;
close my_getid ;

跟踪显示错误信息如下:
cursor is not open

这到底怎么回事,难道是数据库连接方式的问题?

------解决方案--------------------
cursor is not open
一般是在没有写OUTPUT的情况下才会报,你这个情况有点特殊,可能跟表的操作有关,你试着把存储过程中SELECT, UPDATE, INSERT 的语句屏蔽掉, 仅使用最简单的set @iFatherId = 1 这一类的语句看看,还会不会报错
------解决方案--------------------
DECLARE my_getid procedure for sp_GetID
@RemoteId = "00",@cAcc_Id = :ls_acc,@cVouchType = "SK",@iAmount = 1,@iFatherId =:ll_fid output,@iChildId = :ll_cid output using jiekou_yu Using SQLCA;

-------------------
加上 Using SQLCA ; 试试!
  相关解决方案