29
Views
2
Comments
Solved
Handling RAISERROR from executing a stored procedure
Question

When executing a stored procedure I need to display the message that comes from the RAISERROR statement, but all I can get OutSystems to display is "Error executing query."

How can I capture the error message coming from the stored procedure and display that on the front end?


We're on platform 11, on-premises

2019-09-04 15-40-39
Isaac Bailey
Solution

I ended up wrapping my stored procedure call in a Try/Catch and just selected the ERROR_MESSAGE().

Then I'm raising and exception if the error message ins't an empty string and setting the exception message to the value coming from ERROR_MESSAGE().

Thanks Rahul, you helped set me on the right path.

2026-02-26 06-29-24
Rahul
 
MVP

Hi Isaac,

 When you call a stored procedure , create a seprate action for this and handle error exception and set abort transcation property no.

After that bind a list for input and outpur parameter list like below image-


When SP getting any error pass this error in ouput list and show this message accordingly.


Like below image


Hope this will help you.

Kind Regard

Rahul Sahu

2019-09-04 15-40-39
Isaac Bailey
Solution

I ended up wrapping my stored procedure call in a Try/Catch and just selected the ERROR_MESSAGE().

Then I'm raising and exception if the error message ins't an empty string and setting the exception message to the value coming from ERROR_MESSAGE().

Thanks Rahul, you helped set me on the right path.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.