As I said in the previous comment, the current problem is in resolving the Type for the CASE overall. For example, in the CASE:
case when someExpression = 'someLiteral' then :someParam else someOtherExpression end
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:
case when someExpression = 'someLiteral' then :someParam else :anotherParam end
The only solution I can think of for that problem is to require CASTing the parameters:
case when someExpression = 'someLiteral' then cast( :someParam as String ) else cast( :anotherParam as String) end
(at least one of them):
case when someExpression = 'someLiteral' then cast( :someParam as String ) else :anotherParam end
or CASTing the CASE statement overall:
cast( case when someExpression = 'someLiteral' then :someParam else :anotherParam end as String )
BTW, the query in the original report is not conceptually valid since it gives no ELSE result.
|