I have a foundset which I need to sort after a search. The column i’m sorting on is a varchar column. There can be null values in it. What I need to do is, to sort on this column so that the value ‘1’ always comes first. And null values come last. When I sort the foundset like foundset.sort(‘special_priority asc’), null values come first and then the rest is correct (e.g. null,null,null,1,2,3…).
I think Servoy should play a role (as data intermediate between database and application) in the order of nulls when sorting.
Servoy claims to be database independent (what we appreciate very much) and now we face with the shift from Sybase to PostgreSQL a noticeable difference in the data presentation order !
A stored calculation is IMHO an unwanted workaround and no solution…
Maybe the sort options asc and desc can be extended (optional) with something as nulls last and nulls first
if all or most databases has special syntax for them so that we can control that behavior then it could be done
But i think this is not the case, but i could be mistaken.
This could give unexpected results (what max date to use then?) and possibly sql errors on some databases, so we leave the default ordering of nulls to the database.
Unfortunately, the default is different between sybase and postgres and you cannot configure this in postgres at server, database of session level, the default is hard-coded.