From: Marco M. <mm...@ly...> - 2003-03-03 21:50:58
|
What kind of 'magic' are you telling about? I know how to raise an exception, but not how change the message in a SP... I think that ofter a more precise (informative) exception message is welcome, but we must take care to avoid: a) exception definition proliferation, i.e. you end up with 1,000 different exception just to be more informative b) "build on the fly" exception, where you end up with only one exception, and build it's message "as needed". My suggestion is to create something like "exception families", or "cutomizable exception", so for invalid date you can have EXP_INVALID_QUANTITY = 'THE QUANTITY {1} IN {2} IS TOO SMALL, MINIMUM {3}'; and in some trigger, have: IF (NEW.BEER_QT < 100) THEN EXCEPTION EXP_INVALID_QUANTITY(NEW.BEER_QT, 'beer', '100'); IF (NEW.FIREBIRD_ORDERS_QT < 5000) THEN EXCEPTION EXP_INVALID_QUANTITY(NEW.FIREBIRD_ORDERS_QT, 'Firebird servers', '5,000'); regards Marco Menardi Dmitry Yemanov wrote: > Nickolay, > > >>>I think that this is discussion concerning 2.0 :) >> >>I think it is still possible to bribe Dmitry to implement this >>feature in 1.5. ;)) > > > Sorry, but it's not problem for Dmitry to just write small SP in his > databases to handle parameters in exception messages ;-) > > > Dmitry > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Firebird-devel mailing list > Fir...@li... > https://lists.sourceforge.net/lists/listinfo/firebird-devel > |