: Try to cast MySQL decimal data type to string, i.e.
: 
: CAST( IF(drt.discount IS NULL,'0',(drt.discount/100)) AS CHAR) as discount
: (or CAST AS TEXT)

...to clarify here, the values you are seeing are what happens when the DB 
returns to DIH a value in a type it doesn't udnerstand -- in this case 
it's a byte array.  DIH isn't sure what do do with this byte array, so it 
just calls the java "toString()" method on it.

casting that byte array to something DIH understands (like a string) is 
one way to solve the problem, but the other would be to use some SQL 
expression that always returns aconsistent type, so the SQL server knows 
what type to declare in it's response -- in your example you are sometimes 
returning a string (if NULL, you return the string '0') and sometimes 
returning a number (if not null, drt.discount/100) 

use SQL that alwasy returns a number, and this problem will also go away.


-Hoss

Reply via email to