UniLoader error "Cannot insert explicit value for identity column"

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
ertank
Posts: 172
Joined: Wed 13 Jan 2016 16:00

UniLoader error "Cannot insert explicit value for identity column"

Post by ertank » Tue 25 Oct 2016 22:35

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.

ertank
Posts: 172
Joined: Wed 13 Jan 2016 16:00

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

Post by ertank » Wed 02 Nov 2016 23:04

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.

azyk
Devart Team
Posts: 1119
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

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

Post by azyk » Fri 04 Nov 2016 11:42

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.

azyk
Devart Team
Posts: 1119
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

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

Post by azyk » Thu 17 Nov 2016 14:09

We have answered you at the following topic: viewtopic.php?f=28&t=34514

ertank
Posts: 172
Joined: Wed 13 Jan 2016 16:00

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

Post by ertank » Tue 22 Nov 2016 21:56

I confirm that 6.4.16 version fixed the problem.

Thanks.

Post Reply