开发者

How can like 'z%' in eclipse query when 'z' is my parameter

For example

select custName 
from Customer
where custName like '%john%';

My parameter is custName, so in query Eclipse Birt report, I used

select custName 
from Customer
where custName like '%?%';

But it wont work, how can I make this possible. I need help. C开发者_StackOverflowan anyone solve this matter?


You need to include the wildcard characters (%) in the parameter value.

For example

-- Parameter Value = "%john%"

SELECT custName from Customer WHERE custName LIKE ?


In Standard SQL, for which the concatenation symbol is || it would be:

WHERE custName LIKE '%' || :param_name || '%';

Guessing a translation to Eclipse:

WHERE custName LIKE CONCAT('%', param_name, '%');


For what it's worth, nearly 4 years later, this seems to work:

WHERE custName LIKE '%' || ? || '%'
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜