As I said in the previous comment, the current problem is in resolving the {{Type}} for the CASE overall. For example, in the CASE:
{code} case when someExpression = 'someLiteral' then :someParam else someOtherExpression end {code}
we can interpret the overall Type for the case, because one of the results is Typed (here, the ELSE result). However, when all the possible results are parameters we cannot resolve the Type:
{code} case when someExpression = 'someLiteral' then :someParam else :anotherParam end {code}
----
The only solution I can think of for that problem is to require CASTing the parameters:
{code} case when someExpression = 'someLiteral' then cast( :someParam as String string ) else cast( :anotherParam as String string ) end {code}
(at least one of them):
{code} case when someExpression = 'someLiteral' then cast( :someParam as String string ) else :anotherParam end {code}
or CASTing the CASE statement overall:
{code} cast( case when someExpression = 'someLiteral' then :someParam else :anotherParam end as String string ) {code}
BTW, the query in the original report is not conceptually valid since it gives no ELSE result.
|