Subject | Re: [firebird-support] Re: NULL Date values |
---|---|
Author | Paul Vinkenoog |
Post date | 2007-09-10T17:06:26Z |
In addition:
- with descriptors, UDFs can always handle NULLs
- with cstrings, even if the UDF can handle NULL input, the
Firebird engine will by default pass NULL arguments as empty strings,
*unless* you use Firebird 2 *and* the function is declared in a
special way to the database. Fot details, see
http://www.firebirdsql.org/manual/nullguide-udfs.html
and more in particular
http://www.firebirdsql.org/manual/nullguide-udfs.html#nullguide-udfs-fb2-impr
But it's probably quicker to follow Nando's advice and use a CASE
statement. Still it would be a good idea to report this undesired
behaviour to the rfunc team.
Cheers,
Paul
> Look at the declaration of the function DateToStrIf you should choose to go down this avenue I should add that
> (...)
> If, on the other hand, it is passed by reference (pointer or
> cstring) or by descriptor, the function can tell NULLs from zeroes
> and should be improved.
- with descriptors, UDFs can always handle NULLs
- with cstrings, even if the UDF can handle NULL input, the
Firebird engine will by default pass NULL arguments as empty strings,
*unless* you use Firebird 2 *and* the function is declared in a
special way to the database. Fot details, see
http://www.firebirdsql.org/manual/nullguide-udfs.html
and more in particular
http://www.firebirdsql.org/manual/nullguide-udfs.html#nullguide-udfs-fb2-impr
But it's probably quicker to follow Nando's advice and use a CASE
statement. Still it would be a good idea to report this undesired
behaviour to the rfunc team.
Cheers,
Paul