Problems with TClientDataSet.ApplyUpdates (UPDATE) when linked to UniStoredProc with update SQLs set

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
stevel
Posts: 125
Joined: Tue 02 Nov 2010 19:01

Problems with TClientDataSet.ApplyUpdates (UPDATE) when linked to UniStoredProc with update SQLs set

Post by stevel » Sun 11 Jan 2015 04:40

Using: Delphi XE2 Enterprise, UniDAC 6.0.1 Professional, Firebird 2.5.3

I have a TClientDataSet linked to a UniStoredProc which has its Update SQLs for INSERT and UPDATE set (to corresponding database stored procedures). The DataSetProvider has ResolveToDataSet set to True.

In my application when I call ClientDataSet.ApplyUpdates it works for INSERTs. (I'm inserting data into a DBGrid that is linked to the ClientDataSet).

However when updating data in grid, ClientDataSet.ApplyUpdates does not work. When checked with DBMonitor, it shows that the SELECT stored procedure to which the client dataset is linked is being called.

Not sure what to do.. how to resolve this? I need it (ApplyUpdates) to call the Update stored procedure that is set in the SELECT UniStoredProc's SQLUpdate property.

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: Problems with TClientDataSet.ApplyUpdates (UPDATE) when linked to UniStoredProc with update SQLs set

Post by ViktorV » Mon 12 Jan 2015 05:48

Unfortunately, we could not reproduce the issue. Please send us a small sample to demonstrate the issue to viktorv*devart*com, including a script to create and fill in the test database object.

stevel
Posts: 125
Joined: Tue 02 Nov 2010 19:01

Re: Problems with TClientDataSet.ApplyUpdates (UPDATE) when linked to UniStoredProc with update SQLs set

Post by stevel » Mon 12 Jan 2015 16:15

Issue has been resolved. The reason the issue was happening is that the UPDATE SQL (of the SELECT stored procedure UniStoredProc) had a parameter that was not mapped back to a output column (ie. field) from the SELECT field list and this was causing it to fail.

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: Problems with TClientDataSet.ApplyUpdates (UPDATE) when linked to UniStoredProc with update SQLs set

Post by ViktorV » Tue 13 Jan 2015 05:42

Glad to see that the issue was resolved. Feel free to contact us if you have any further questions about UniDAC.

Post Reply