pb 调用两次存储 第二次fetch 返回值 sqlerrtext为 cursor is not open
intli_return,li_return2stringls_return,ls_return2stringls_thishqbrch_new,ls_thishqbrc...
int li_return ,li_return2
string ls_return ,ls_return2
string ls_thishqbrch_new,ls_thishqbrch_old
ls_thishqbrch_new = as_cwhm_new
if left(as_cwhm_new,1) = '+' then
ls_thishqbrch_new = Replace(as_cwhm_new,1,1,'%2B')
end if
DECLARE his_changebed PROCEDURE FOR Sp_ChangeBed
@as_inid = :ll_zyh_old,
@as_newbedno = :ls_thishqbrch_new,
@an_return = :li_return OUTPUT,
@as_return = :ls_return OUTPUT;
EXECUTE his_changebed;
IF SQLCA.sqlcode = -1 Then
//失败
MessageBox("提示信息","换床调用Sp_ChangeBed存储过程失败:"+sqlca.SQLErrText)
GOTO Process_Error
End IF
fetch his_changebed into :li_return ,:ls_return;
IF li_return <> 1 Then
//失败
MessageBox("提示信息","换床调用his_changebed存储过程失败:"+ls_return )
End IF
Close his_changebed;
IF li_return<>1 THEN GOTO Process_Error
if ll_zyh_New <> 0 then
ls_thishqbrch_old = as_cwhm_Old
if left(as_cwhm_Old,1) = '+' then
ls_thishqbrch_old = Replace(as_cwhm_Old,1,1,'%2B')
end if
DECLARE his_changebed2 PROCEDURE FOR Sp_ChangeBed
@as_inid = :ll_zyh_new,
@as_newbedno = :ls_thishqbrch_old,
@an_return = :li_return2,
@as_return = :ls_return2;
EXECUTE his_changebed2;
IF SQLCA.sqlcode = -1 Then
//失败
MessageBox("提示信息","换床调用Sp_ChangeBed2存储过程失败:"+sqlca.SQLErrText)
GOTO Process_Error
End IF
fetch his_changebed2 into :li_return2 ,:ls_return2;
IF SQLCA.sqlcode = -1 Then
//失败
MessageBox("提示信息","换床调用Sp_ChangeBed存储过程失败:"+sqlca.SQLErrText)
MessageBox("提示信息","换床调用his_changebed2存储过程失败:"+ls_return2 )
End IF
Close his_changebed2;
IF li_return2<>1 THEN GOTO Process_Error
end if
第一次fetch 的sqlca.sqlcode = 0 第二次的返回值是 -1 两次调用的写法错了吗 展开
string ls_return ,ls_return2
string ls_thishqbrch_new,ls_thishqbrch_old
ls_thishqbrch_new = as_cwhm_new
if left(as_cwhm_new,1) = '+' then
ls_thishqbrch_new = Replace(as_cwhm_new,1,1,'%2B')
end if
DECLARE his_changebed PROCEDURE FOR Sp_ChangeBed
@as_inid = :ll_zyh_old,
@as_newbedno = :ls_thishqbrch_new,
@an_return = :li_return OUTPUT,
@as_return = :ls_return OUTPUT;
EXECUTE his_changebed;
IF SQLCA.sqlcode = -1 Then
//失败
MessageBox("提示信息","换床调用Sp_ChangeBed存储过程失败:"+sqlca.SQLErrText)
GOTO Process_Error
End IF
fetch his_changebed into :li_return ,:ls_return;
IF li_return <> 1 Then
//失败
MessageBox("提示信息","换床调用his_changebed存储过程失败:"+ls_return )
End IF
Close his_changebed;
IF li_return<>1 THEN GOTO Process_Error
if ll_zyh_New <> 0 then
ls_thishqbrch_old = as_cwhm_Old
if left(as_cwhm_Old,1) = '+' then
ls_thishqbrch_old = Replace(as_cwhm_Old,1,1,'%2B')
end if
DECLARE his_changebed2 PROCEDURE FOR Sp_ChangeBed
@as_inid = :ll_zyh_new,
@as_newbedno = :ls_thishqbrch_old,
@an_return = :li_return2,
@as_return = :ls_return2;
EXECUTE his_changebed2;
IF SQLCA.sqlcode = -1 Then
//失败
MessageBox("提示信息","换床调用Sp_ChangeBed2存储过程失败:"+sqlca.SQLErrText)
GOTO Process_Error
End IF
fetch his_changebed2 into :li_return2 ,:ls_return2;
IF SQLCA.sqlcode = -1 Then
//失败
MessageBox("提示信息","换床调用Sp_ChangeBed存储过程失败:"+sqlca.SQLErrText)
MessageBox("提示信息","换床调用his_changebed2存储过程失败:"+ls_return2 )
End IF
Close his_changebed2;
IF li_return2<>1 THEN GOTO Process_Error
end if
第一次fetch 的sqlca.sqlcode = 0 第二次的返回值是 -1 两次调用的写法错了吗 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询