문제

I seem to have come across a strange restriction in using bind variables in MonetDB. If i use bind variables in the normal way by saying where field=${var} then it works. But not in this case:

Here is a sample:

select case when ${Brand} = 'All'

And here is the error:

EXEC: wrong type for argument 1 of prepared statement: char, expected char

Using the latest version of the jdbc driver (2.9) via Pentaho.

도움이 되었습니까?

해결책

Casting to char doesnt work either.

However casting both sides to Varchar does work i.e.:

cast(${Brand} as varchar(100)) = cast('All' as varchar(100))

So I guess char's are just a bit funky in MonetDB

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top