RAISE ERROR statement in my RWDBStoredProc never catches that error.

Article ID: 1011
Last updated: 05 Feb, 2008
Article ID: 1011
Last updated: 05 Feb, 2008
Revision: 1
Views: 4408
Posted: 02 Sep, 1997
by Dean J.
Updated: 05 Feb, 2008
by Dean J.
Problem


My stored procedure has a RAISE ERROR statement, but my RWDBStoredProc never catches that error.


Cause


Some databases (Sybase, Oracle, etc.) allow you raise an error inside stored procedures. During procedure execution, if that statement has been executed, the server will trigger that error (send an error message with the error code defined by that stored procedure). The RWDBStoredProc itself should still be in valid condition. That's why you can't get that error from the RWDBStoredProc.


Action


To catch that error message, check the master status by setting an error-handling function on RWDBManager using RWDBManager::setErrorHandler() to catch the error message. See the DBTools.h++ User's Guide chapter The Error Model for more information on how to write errror handling functions.
This article was:   Helpful | Not helpful
Report an issue
Article ID: 1011
Last updated: 05 Feb, 2008
Revision: 1
Views: 4408
Posted: 02 Sep, 1997 by Dean J.
Updated: 05 Feb, 2008 by Dean J.

Others in this category