Subject Re: [firebird-support] Digest Number 3896
Author Erik De Laet
Yes, I know about the CASE construct. I have read the sample in the doc
files (and in Helen's book), but, as in any other language, you could use a
CASE in each case (pun intended) you now use an IF.

It's just that an IF would be more logical here (with less code to write).

Erik

At 16:32 12/03/2006, you wrote:
>Hello Erik,
>
>EDL> Is there any reason why the IF doesn't work, or is it just a design
>decision.
>CASE is more "general" statement: if you refer to its syntax
>description, you'll see that you can use constructions like
>-----
> SELECT
> o.ID,
> o.Description,
> CASE
> WHEN (o.Status IS NULL) THEN 'new'
> WHEN (o.Status = 1) THEN 'confirmed'
> WHEN (o.Status = 3) THEN 'in production'
> WHEN (o.Status = 4) THEN 'ready'
> WHEN (o.Status = 5) THEN 'shipped'
> ELSE 'unknown status ''' || o.Status || ''''
> END
> FROM
> Orders o
>-----
>(the example is from the README.case doc file)
>


----------
Erik De Laet - programmer by choice and profession
CEO
E.De.L.Com bvba - The Software Bridge to the User!

----------
Developer of Sitestepper - maintain your web site

----------
Lambrechtshoekenlaan 211 - 2170 Merksem ( Antwerpen ) - Belgium
tel: (32)3-541 77 24 - fax: (32)3-542 49 69 - mobile: (32)475-32 99 47 -
(32)475-81 67 83
web: http://www.edelcom.com - http://www.sitestepper.com - email:
info@...

[Non-text portions of this message have been removed]