Subject | Re: [firebird-support] UDFs and Exceptions |
---|---|
Author | Nando Dessena |
Post date | 2006-08-04T07:03:48Z |
Michael,
f> So then I tried creating a stored procedure as an intermediary, which could
f> detect the pattern error and raise an exception. Unfortunately, it appears
f> that SPs can't be used as part of a predicate. Is there a way around this?
the expression (select RESULT from SP_REGEXMATCH(...)) can be used in
a predicate. Until stored functions are implemented in Fb, I think
this is your best bet.
And, I agree that a way to signal an exception from a UDF would be a
very useful addition, although that wouldn't save you from doing
exception trapping in your UDF's body, to convert a language (or
possibly hardware/external) exception to whatever machanism is
implemented in Firebird's UDF API.
Ciao
--
Nando Dessena
======================================================
I support Firebird, I am a Firebird Foundation member!
Join today at http://www.firebirdsql.org/ff/foundation
======================================================
f> So then I tried creating a stored procedure as an intermediary, which could
f> detect the pattern error and raise an exception. Unfortunately, it appears
f> that SPs can't be used as part of a predicate. Is there a way around this?
the expression (select RESULT from SP_REGEXMATCH(...)) can be used in
a predicate. Until stored functions are implemented in Fb, I think
this is your best bet.
And, I agree that a way to signal an exception from a UDF would be a
very useful addition, although that wouldn't save you from doing
exception trapping in your UDF's body, to convert a language (or
possibly hardware/external) exception to whatever machanism is
implemented in Firebird's UDF API.
Ciao
--
Nando Dessena
======================================================
I support Firebird, I am a Firebird Foundation member!
Join today at http://www.firebirdsql.org/ff/foundation
======================================================