I have a problem finding empty integer fields in servoy. And could not find this with a few searches on this forum yet.
This is my code: ( box_id is defined as integer)
controller.find();
production_order_id=globals.SELECTED_PO_ID;
box_id = ‘^’ ; // all empty values : NULL’s in SQL server
controller.search(true,false);
When I run this Servoy is returning the error :
Setting dataprovider with name ‘box_id’ / type ‘INTEGER’ with value of wrong type ^
What I try to accomplish is finding all data where the box_id field was never filled with any data.
Is there anyone who can help me with this ? I’m using SQL server as database ( version 2005 ).
What driver are you using?
What Java version?
What Servoy version?
Is the “box_id” an INT?
What if you just use controller.search() rather than the explicit controller.search(true,false)?
I have found my problem after a long search.
I was not aware that in version 3 you need to specify manually :
databaseManager.setAutoSave(true);
Now you always need to check if the find results : “true”
if (controller.find())
{
field='='+value;
controller.search();
}
Whithout this check you are assigning values to your data field.
( so possibly corrupting your data )
So I was assigning ‘^’ to an integer field, which resulted into the error.
This is new with version 3, it worked fine in my previous beta version of version 3, and in version 2.
It would be nice to have some kind of global find and replace routine, since I have to check many of pages with code. All potentialy able to corrupt the data, if not changed in time.
Do you, or anybody else know if there is a document that describes all the possible upgrades that you need to do to existing code to make it work safely with version 3 ? Now I have the feeling that I’m working on a trial and error basis.
It would be nice if at least the HTML help will work again soon for version 3.