1

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.

4

1 回答 1

3

转换为 char 也不起作用。

然而,将双方都转换为 Varchar 确实有效,即:

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

所以我猜 char 在 MonetDB 中有点时髦

于 2013-07-09T08:30:53.040 回答