Mark Junker created issue - 21/Oct/11 12:25 AM
The first patch simplifies the SQL transformation function.
The second patch has the following effect:
Change all (case when ... then ... else ... end) expressions into something like:
IIf(IsNull(Switch(when_1, then_1, ... when_n, then_n)), else, Switch(when_1, then_1, ... when_n, then_n))
or (when no "else" part exists):
Switch(when_1, then_1, ... when_n, then_n)
Mark Junker added a comment - 24/Oct/11 9:07 PM
This patch moves the CASE conversion to the top of the function. It also renames the function to something more suitable.
Mark Junker added a comment - 25/Oct/11 10:31 PM
Fixes problems with the created Switch statements (multiple and duplicate WHEN parts)
Mark Junker added a comment - 25/Oct/11 10:34 PM
Use the original SQL string as cache key