Home > database >  PB calls for error information
PB calls for error information

Time:09-28

My database is MSSQL2005
I wrote in the process of the LEFT (ISNULL (ERROR_MESSAGE (), ' '), 250) to capture the error message,
But I can't get the error in the front desk PB program information,
The question now is, as long as there is an error in the routine storage process information, in PB call occurs when
Cusorisnotopen error information,

DECLARE the Proc Procedure FOR
Usp_instore_msg_state @ sheet_id='INM09120001, @ within_code=' 01 '@ check_by=' a ', @ result=: ls_errtext output;
The EXECUTE the Proc.
The FETCH Proc Into: ls_errtext;
MessageBox (String (SQLCA SQLCode), the SQLCA. SQLErrText + '; '+ ls_errtext)
The SQLCA. SQLErrText information rate is: cusorisnotopen
Ls_errtext information is empty
I can't achieve database error back to feed back information


Excuse me this how to solve, if in Oracle the error information can be obtained in this way, but I don't know in SQL if not?

CodePudding user response:

With the cursor calls?
The FETCH Proc Into: ls_errtext;
This error

CodePudding user response:

LEFT (ISNULL (ERROR_MESSAGE (), ' '), 250) values can be used as a return parameter
Through the return value judgment
Or raise_error, at each step the sqlca. Sqlerrtext
Rather than judgment to fetch
The fetch only perform success can have value?

CodePudding user response:

Sun1976:
Don't quite understand what you mean,
I have custom in the storage process, cheng wrong information or wrong information in the system, are output through the output parameters, I achieved by fetchinto the error parameter, this way, if you don't ride in the process of storage and begintran, then you can get, but a but add begintran, cusorisnotopen error will occur

CodePudding user response:

Then remove begintran ah

CodePudding user response:

Yes, the background and if raise_error, pb call will have problems

The
refer to the original poster sunram response:
my database is MSSQL2005
I wrote in the process of the LEFT (ISNULL (ERROR_MESSAGE (), ' '), 250) to capture the error message,
But I can't get the error in the front desk PB program information,
The question now is, as long as there is an error in the routine storage process information, in PB call occurs when
Cusorisnotopen error information,

DECLARE the Proc Procedure FOR
Usp_instore_msg_state @ sheet_id='INM09120001, @ within_code=' 01 '@ check_by=' a ', @ result=: ls_errtext output;
The EXECUTE the Proc.
The FETCH Proc Into: ls_errtext;
MessageBox (String (SQLCA SQLCode), the SQLCA. SQLErrText + '; '+ ls_errtext)
The SQLCA. SQLErrText information rate is: cusorisnotopen
Ls_errtext information is empty
I can't achieve database error back to feed back information


Excuse me this how to solve, if in Oracle the error information can be obtained in this way, but I don't know in SQL if not?

CodePudding user response:

The top,

CodePudding user response:

The output=out?
  • Related