Not sure it’s a bug, anyway I can’t deselect the Allow Null option from newly created dataproviders: is it normal?
Servoy 2.1, OSX.3.5
Not sure it’s a bug, anyway I can’t deselect the Allow Null option from newly created dataproviders: is it normal?
Servoy 2.1, OSX.3.5
Yes, it’s normal in the following case:
When you allready have a table with possible data (records) in it and then you add a new column (dataprovider), you cannot deselect the “Allow null” option, because there is allready data in the table and for all the existing records, the value of your new dataprovider has value null.
So, if you would be able to deselect the “Allow null” option, there would be a constraint violation.
If you do need this new column not to allow Null values, you need to do the adding through a DB tool (Sybase Central for example if you’re working on Sybase). You can then create the extra column with a default value AND the “Allos Null” option deselected.
Paul
pbakker:
Yes, it’s normal in the following case:When you allready have a table with possible data (records) in it and then you add a new column (dataprovider), you cannot deselect the “Allow null” option, because there is allready data in the table and for all the existing records, the value of your new dataprovider has value null.
So, if you would be able to deselect the “Allow null” option, there would be a constraint violation.
If you do need this new column not to allow Null values, you need to do the adding through a DB tool (Sybase Central for example if you’re working on Sybase). You can then create the extra column with a default value AND the “Allos Null” option deselected.
Paul
Thanks Paul: a very clear explanation
I’ve tried modifying new columns to disallow null through my MySQL client, e.g.
ALTER table validation_test modify column not_null_field varchar(50) not null
But after I do that I stop getting exceptions for any of my not null fields (including the original not null fields I created before the table had data which used to give me exceptions).
I assume this is a bug?
Servoy Developer
Version 3.5.3-build 516
Java version 1.6.0_03-b05 (Linux)
In fact, it seems this problem also applies to tables with not-null fields created during table creation (i.e. not afterwards directly with a DB tool).
I can create not-null fields when I first create a table and validation will work until I restart the application, at which point validation stops working and the not-null fields are created ‘empty’.
This is all using a fresh repository and db (transactional).
Any thoughts?