Subject RE: [firebird-support] rFunc UDF - linux and Windows
Author Codebue Fabio - P-Soft
[quote ./helen]
As an update on this (remembering a comment from Claudio one time), either
i64round() or round() should work with any valid data. Internally, the
function call would process the descriptor of the input and execute the
appropriate function call. You can declare both functions if you want the
specifically different output types, but neither should except *if the data
is valid*.
....
[/quote ./helen]
k.. I understood now...

[quote ./helen]
You should ensure that the data types declared for your variables are
compatible with the results returned from the functions. For example:

declare external function i64Round
numeric(18, 4) by descriptor, numeric(18, 4) by descriptor
returns parameter 2
entry_point 'fbround' module_name 'fbudf'

-- says that i64round will return a result (parameter 2) that is
numeric(18,4). Your 32-bit variables (float and integer) are not compatible
with numeric(18,4).
[/quote ./helen]
ok...

[quote ./helen]
Note too that this trigger code would throw this exception if either
new.quantita or old.quantita was null. NULL is not a valid argument to an
arithmetic function. Your trigger should test for null and not apply the
rounding function if either the OLD or the NEW value were null. If you
don't understand the difference between NULL and values, there's an
excellent Null Guide document available at the Firebird website.
...
And fix up the logic in any of your triggers that are not handling NULLs.
;-)
[/quote ./helen]
my trigger it's about 300 lines so I don't want to report to my mail for a
better reading of it. Naturally I understand difference from NULL and
values, I read italian and english version of that guide...

thanks a lot Helen, you are my favourite google-answer-finder ;)

Codebue Fabio
.-----------------------------.
_ \ __| _||
__/____|\__ \ _ \ _| _|
_| ____/\___/_| \__|

P-Soft di Codebue Fabio & C. sas
via B.Storti, 19
24060 - Chiuduno - BG
Italy
Phone: +39.030.839435
Fax: +39.030.5100306
Mobile: +39.348.3515786
.-----------------------------.
Web : www.p-soft.biz
EMail: f.codebue@...