Page 1 of 1

Loader with "NOT NULL DEFAULT VALUE" fields

Posted: Tue 27 Oct 2015 08:16
by Licences AAW
[UniDac 6.1.5]

Hello,
I'm facing a case I don't know how to handle. In a SQL Server database, I have a table with some "NOT NULL DEFAULT VALUE" fields.
In my application, I have a bulk of data to load in this table with a TUniLoader. But some of the data doesn't permit to "calculate" those fields values. So I want the server apply their "DEFAULT VALUE" constraints.
The problem is that I can't find a way to inform TUniLoader a column is "not assigned" (neither valued nor "null"). It seems TUniLoader consider not assigned values as null and send "null" to the server. And then the server raises a "Not null" exception.

Until now, the only way I found is to load data in two phases: a phase with pre-calculated "not null default value" fields, and a phase where those fields are excluded from TUniLoader. Not very convenient in my case.

So, is there a way to prevent TUniLoader to send "Null" when the field is "Unassigned" ?

(with SQLServer provider, it seems the case when MSParam.IsBound is False, but nothing allows to change this property)

Re: Loader with "NOT NULL DEFAULT VALUE" fields

Posted: Tue 27 Oct 2015 16:00
by azyk
Currently, there is no possibility to set the DEFAULT value, that is declared on the server, for a field in the TUniLoader.OnPutData event handler. You can suggest this feature at our UserVoice ( http://devart.uservoice.com/forums/1046 ... 939-unidac ). If the suggestion gets a lot of votes, we will consider the possibility to implement it.

Re: Loader with "NOT NULL DEFAULT VALUE" fields

Posted: Wed 28 Oct 2015 08:23
by Licences AAW
Thank's for the answer

I add suggestion for new feature:
http://devart.uservoice.com/forums/1046 ... tuniloader

Re: Loader with "NOT NULL DEFAULT VALUE" fields

Posted: Fri 30 Oct 2015 13:12
by azyk
If any other questions come up, please contact us.