Subject RE: [firebird-support] Using CIF UDF
Author Kevin Lingofelter
Excellent...thanks a million!

I looked at case before diving into the UDFs but for some reason, couldn't
get my head around it. I guess sleeping is good!

Kevin Lingofelter

-----Original Message-----
From: Steffen Heil [mailto:lists@...]
Sent: Wednesday, July 14, 2004 2:34 AM
To: firebird-support@yahoogroups.com
Subject: RE: [firebird-support] Using CIF UDF


Hi

> >select CIF((APPLICATIONS.CID = 'N/A'), '', APPLICATIONS.ENG_TYPE || '
> >CID') as CI
> > >From APPLICATIONS

> If you're using Fb 1.5 you can use a CASE expression:
>
> select
> ....,
> CASE CIF(CID) = 'N/A' then ''
> ELSE ENG_TYPE || ' ' || CIF(CID) END AS WHATEVER, ....
> from APPLICATIONS

Which should also be faster, since for calling an procedure, all parameters
need to be evaluated, whereas the CASE needs to evaluate the conditional and
the real result expression only.

Regards,
Steffen





Yahoo! Groups Links