IDS 7.31 : User-defined exceptions in SPL
Posted in 2000
Hi again, I still have troubles with exceptions in SPL stored procedures. I would like to send back to caller processes of my procedures 'home-defined' exceptions but I can't find any tip, neither in Informix documentation nor on the IIUG site. Here is an example of the exception bloc in my procedures : ON EXCEPTION SET v_errnum, v_eisam, v_errmsg IF v_errnum IN (-xxx) THEN LET v_errmsg = 'my_message_xxx'; ELIF v_errnum IN (-yyy) THEN LET v_errmsg = 'my_message_yyy'; END IF; RAISE EXCEPTION v_errnum, v_eisam, v_errmsg; END EXCEPTION; I have tried to do so with unused exception but it dos not work as I would like to : - for example, use of exceptions codes -9771 or -5310 : the exception is raised but my error message is not send with the exception code to the sender. I get back something like < SQL Error (-9771) : Unknown error message -9771 >. - use of exception code -1000 : the exception is raised and my error message is also send back to the caller within another message. I get back something like < SQL Error (-1000) : No help message found for the message number "My message" >. - use of exception code -13500 : The execption is raised with a particular message. This message changes with the range of the exception code. I get something like < SQL Error (-13500) : Cannot open file 'isqlrf.iem'. So my questions are : - which exception code can I use for the SQLCODE ? - how to associate an error message on these SQLCODE values (define error messages in particular files, ...) ? Otherwise, is it possible to set the SQLCODE to a value which has not corresponding error message, and to set ISAM Code and message to 'home-defined' values ? Thanks a lot for your answers. -- - ------------------------------------------------------------------ - - Arnaud ANDRIEUX tel direct : 02.99.12.52.22 - - Alliance Qualite Logiciel http://www.aql.fr - - GROUPE SILICOMP http://www.silicomp.fr - - Rue de la Chataigneraie - B.P. 127 - - 35513 CESSON SEVIGNE - FRANCE - - tel : (33) (0)2.99.12.50.00 fax : (33) (0)2.99.63.70.40 - - ------------------------------------------------------------------ -