If after a scripted record update I check the databaseManager.getChangedRecordData() for discover the number of update I get this for unchanged records:
FLOATs columns are tricky, are you sure you really need to use FLOATs?
Usually the problem arises when you store decimal numbers in floats fields, Servoy writes 186.94 to the DB and the DB saves in the floating column 186.94000244140625, then Servoy thinks that there is unsaved data because the two values are different. Why you don’t just use a DECIMAL(10,2) column?
You’re welcome but this is not a trick, FLOATs should only be used when you need to store values with an undetermined number of decimals, basically for mathematic or geometric applications, I’ve never found the need to use them for any commercial application I’ve been working on. As a rule of thumb I think it’s always a good practice to round numeric values before writing them to the DB to prevent unexpected results. If you define a rounding strategy at least you define the precison level of your application by design, using FLOATs to handle rounding could lead you to unexpected results and to the inability of knowing the application precision level.
Harjo:
you guys are right! but…
if you create the column in Servoy with type Number, it will become standard a FLOAT!
Not exactly, with MySQL if you create the column in Servoy as Number AND you don’t specify the lenght it will become a FLOAT (I also had my share of pain with this ).
You need to be sure to set the number of decimals you want in the lenght of the field.