Page 1 of 1

UniLoader error "Cannot insert explicit value for identity column"

Posted: Tue 25 Oct 2016 22:35
by ertank
Hello,

Using Delphi 10.1 Update 1, UniDAC 6.4.14.

I have a table in SqlServer 2012. I want to copy data from SQLite3 database table using UniLoader.

Both tables are identical in terms of structure. SqlServer table has Identity field. SQLite3 table also has autoincrement field. These fields are named as "id" in both tables.

I am selecting all columns but not selecting id (autoincrement) column in a UniQuery from SQLite3 database table, and passing this query to UniLoader. I get error starting with "Cannot insert explicit value for identity column..."

Since I am not selecting ID column in the data to be inserted, I expect UniLoader not to try to insert anything to ID column.

Below link is a small sample project with necessary database files included to test and see for your convenience.
uniloader-identity.rar

I am not sure if this is a feature or a bug. If that is a feature, I appreciate an example showing correct usage, please.

Thanks.

Re: UniLoader error "Cannot insert explicit value for identity column"

Posted: Wed 02 Nov 2016 23:04
by ertank
Hello,

Same sample project is tested using UniDAC 6.4.15.

Error displayed this time is saying "Cannot insert the value NULL into column 'id', table 'test.dbo.giriscikis'; column does not allow nulls. INSERT fails.

Re: UniLoader error "Cannot insert explicit value for identity column"

Posted: Fri 04 Nov 2016 11:42
by azyk
We have reproduced the described issue and now we are working on its fixing. As soon as the issue is fixed, we will notify you about it and send you a night build with this fix.

Re: UniLoader error "Cannot insert explicit value for identity column"

Posted: Thu 17 Nov 2016 14:09
by azyk
We have answered you at the following topic: viewtopic.php?f=28&t=34514

Re: UniLoader error "Cannot insert explicit value for identity column"

Posted: Tue 22 Nov 2016 21:56
by ertank
I confirm that 6.4.16 version fixed the problem.

Thanks.