Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

User defined Error Messages

Status
Not open for further replies.

scarletAni

Programmer
May 14, 2003
22
IN
Hi !!
Is there any way of raising a user defined exception in Teradata ?
I need one and am not able to find relevant material.
Can someone help ?
 
The only way i'm aware of is

ROLLBACK 'An error occured' WHERE any_condition;

which results in error 3513 with errortext 'An error occured'

Dieter
 
Can we use ABORT 'Error Occurred'. Will it shange the value of SQLCODE ?
 
Also how can we check the value 3513 has been assigned to SQLCODE ?
 
ABORT is exactly the same as ROLLBACK.

I never tried it within a Stored Procedure (outside of an exception handler), but checked it now:
ABORT sets SQLCODE to 0 and SQLSTATE to '00000', succesfull completion...

Dieter
 
So, ABORT may not work for me. I must try ROLLBACK. How do I check the SQLCODE value once the procedure is complete ?
 
ABORT is a synonym for ROLLBACK.
And SQLCODE/SQLSTATE is only available within a SP and even within it can't be used to check for ABORT, because it's no error :-(
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top