AmnonM has asked for the wisdom of the Perl Monks concerning the following question:
toIF(expr1,expr2,expr3)
or sometimesCASE WHEN condition THEN result [ WHEN condition THEN result ]... [ ELSE result ] END
CASE expression WHEN value THEN result [ WHEN value THEN result ]... [ ELSE result ] END
Complexity comes in if any of the expr's have commas and brackets, and even nested IFs. This must be a challenge even to people expert in regular expressions.
(The full story is that I'm planning to move from MySQL to Vertica, so other changes might also need to me made. But save this for another time.)
Does anyone know where to start?
Amnon
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: "if" to "case ... end"
by LanX (Saint) on Oct 31, 2013 at 10:41 UTC | |
|
Re: "if" to "case ... end"
by hdb (Monsignor) on Oct 31, 2013 at 09:48 UTC | |
|
Re: "if" to "case ... end"
by Laurent_R (Canon) on Oct 31, 2013 at 10:37 UTC |