yes we did it with dataset.getValue(row, column) and dataset.getAsText
allways with these strange results.
Also with getRowAsArray the Result is hte same while the SQL-Statement it self returns the expexted Nummeric results (for example a Number like 32) in SQL-Tools as phpMyAdmin and MySQL Query Browser.
Seems the query returns a data type that is neither a numeric, integer, string or a date.
This sure sounds like an issue with the jdbc driver or combination jdbc version and database server version. But from what I see you are using the latest version.
But you do use an older (beta even) MySQL server version. Version 5.0.67 is out, you might want to update it.
What happens when you cast the sum into a signed integer using the following query?
var query =
"SELECT 'Text1', ' ' "+
"UNION " +
"SELECT 'Text2', Cast( SUM( IF( stueck <5, stueck, 0 )) AS SIGNED ) AS ' ' "+
"FROM `vip` "+
"WHERE `vipid` IN ('123') "
var dataset = databaseManager.getDataSetByQuery(controller.getServerName(), query, null, maxReturnedRows)
Also why do you use an space as alias-name for the second column in the second query ?
var query =
"SELECT 'Text1', ' ' "+
"UNION " +
"SELECT 'Text2', Cast( SUM( IF( stueck <5, stueck, 0 )) AS SIGNED ) AS ' ' "+
"FROM `vip` "+
"WHERE `vipid` IN ('123') "
var dataset = databaseManager.getDataSetByQuery(controller.getServerName(), query, null, maxReturnedRows)
The result is the same:
[attachment=2]Picture 8.png[/attachment] [attachment=0]Picture 11.png[/attachment]
When i remove the first SELECT statement and UNION
var maxReturnedRows = 100
var query =
"SELECT 'Text2', SUM( IF( stueck <5, stueck, 0 )) AS ' ' "+
"FROM `vip` "+
"WHERE `vipid` IN ('123') "
var dataset = databaseManager.getDataSetByQuery(controller.getServerName(), query, null, maxReturnedRows)
then result is OK:
[attachment=1]Picture 9.png[/attachment]
Also why do you use an space as alias-name for the second column in the second query ?
Because i want to have empty column name, when i use only second SELECT statement. You are right, makes no sence after UNION.
I check “servoy-admin” page, no errors are shown.
Seems the result is not correct only from Servoy. I try 3 different versions of jdbc driver without success.