MySql trouble with SearchForm [message #1131991] |
Thu, 10 October 2013 23:20 |
Boris NN Messages: 5 Registered: October 2013 |
Junior Member |
|
|
Hi,
I am very new to Scout so please be gentle with me, maybe I did something wrong.
1. I created a MySqlSqlService -> Selected Statments worked fine.
2. I created a SearchForm -> Filter dosen´t
I used the debug Mode an figured out that the SQL Statement has an Error: It has an || for concart strings but mysql needs a concat().
Service Class:
public class MySqlSqlService extends AbstractMySqlSqlService implements IService2 {
@Override
protected String getConfiguredJdbcMappingName() {
return "jdbc:mysql://192.168.1.1:3306/test";
}
@Override
protected String getConfiguredPassword() {
return "#######";
}
@Override
protected String getConfiguredUsername() {
return "#######";
}
}
LOG:
SQL with binds:
SELECT ID,
LASTNAME,
FIRSTNAME,
BIRTHDAY,
DISPLAYNAME
FROM RESIDENTS
WHERE 1 = 1
AND UPPER(FIRSTNAME) LIKE UPPER(:firstName || '%')
IN :firstName => ? [VARCHAR Boris]
SQL PLAIN Log:
SELECT ID,
LASTNAME,
FIRSTNAME,
BIRTHDAY,
DISPLAYNAME
FROM RESIDENTS
WHERE 1 = 1
AND UPPER(FIRSTNAME) LIKE UPPER('Boris' || '%')
Any idea?
Cheers,
Boris
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03642 seconds