1. Jvallejo Jvallejo
  2. PowerBuilder
  3. Sunday, 25 October 2020 22:21 PM UTC

Hello.

Is there any way to catch a stored procedure error when retrievign a datawindow?. I get the error 999 Select error: Requested result set number 1 not found, so I need to catch the return number that I specifed in the definition of the SP.  Edit: The DBError only catches Raiserror from SP (ASE Sybase) not the Return number.

Thx.

Accepted Answer
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Sunday, 25 October 2020 23:53 PM UTC
  2. PowerBuilder
  3. # Permalink

Maybe the stored procedure has changed? Or maybe you don't have access rights?

Try creating a new datawindow and select the stored procedure again from the list. See if there are any differences.

regards

Comment
  1. Miguel Leeuwe
  2. Monday, 26 October 2020 10:55 AM UTC


Oh Okay: SAP sybase ASE, in that case you could return a SELECT "myerrormessage" from DUMMY;

the amount of columns and type in that Select have to coincide with the columns you would normally return when there's no error.
  1. Helpful
  1. Jvallejo Jvallejo
  2. Tuesday, 27 October 2020 02:53 AM UTC
Ok!!! Thanks for the help, so it's impossible to get return values from the SP and I have only two ways, use raiserrors to catch any validation error or get it from the result set as a dummy select.

Thank u!
  1. Helpful
  1. Miguel Leeuwe
  2. Tuesday, 27 October 2020 03:00 AM UTC
I would use Raiserrors and check on them in the DBError event, yes. You can always customise the message that you give from there.

yw.
  1. Helpful
There are no comments made yet.


There are replies in this question but you are not allowed to view the replies from this question.