Informix User Defined Exception
Posted in 2000
Topics: Stored Procedures & SPL
Hi, We are using Informix 9.2. And, there are situations that, when a stored procedure encounters a database issue, I would like to send a meaningful message to the user. But, we were told by Informix tech suport that, we have to chagne a txt file, and re-compile it. However, they were not willing to provide us with the compiler. Question - is there any way I can check on stored procedure, and response to the user with a"User Defined Message", vs. systems message ? Any thoughts, or comments will be appreciated ! Fan - Ming (fsu@genuity.com)
Sure you can , if I understand what you want, although I'm not clear about what your "database issue" means. You need to RAISE EXCEPTION -746. Something like below : IF blah blah.... LET error_message="Ouch!"; RAISE EXCEPTION -746, 0, error_message; END IF; Examine the SQL Syntax manual -> SPL commands->RAISE EXCEPTION for details. Rudy fsu wrote: > We are using Informix 9.2. And, there are situations that, when a stored > procedure encounters a database issue, I would like to send a > meaningful message to the user. But, we were told by Informix tech > suport that, we have to chagne a txt file, and re-compile it. However, > they were not willing to provide us with the compiler. > > Question - is there any way I can check on stored procedure, and > response to the user with a"User Defined Message", vs. systems message ? > > Any thoughts, or comments will be appreciated ! > > Fan - Ming (fsu@genuity.com)