JDBC binder CONCAT

Confluence User - 08 Sep, 2016

Hello I got problem with jdbc binder and concatenating I got group of 3 columns, where always 2 of columns are NULL and 1 got a value, I need to get that value. Simplest solution working on mysql is this.

select  
CONCAT(IFNULL(c_col1,"")+IFNULL(c_col2,"")+IFNULL(c_col3,"")) as value,
main.* 
from app_fd_main as main

When I run this query directly on mysql everything is fine, when I try to use it as JDBC binder for datalist, I am getting String reference with CONCAT, without CONCAT I am geting numeric value(those columns are strings so also wrong response).

By String reference I mean something like this 

[B@a408cdc
[B@4de4ddbe

 

Thank you for help.

datalists;jdbc;query;mysql;concat

1


10 Sep, 2016
confluenceUser
confluenceUser

Hi,

As I don't have an app_fd_main table, I modified the query slightly using the dir_user table 

select 
CONCAT(IFNULL(username,"")+IFNULL(firstName,"")+IFNULL(lastName,"")) as value,
main.*
from dir_user as main

and it seems to work as expected, returning a numeric value for the value column. I tried it on version 5.0.8

 

RELATED QUESTIONS

Your answer


To answer a question you'll need an account.

Print