Problem during executing refresh dataset MSSQL

MSSQL Berlin Latest DA VCL

I am receiving the following error when applying updates:

Followed by:

The updates are actually applying and not failing, so the error seams to be when returning the updated data.

The sql statement looks like this:

I am not sure what I am doing wrong.

as I understand, you are updating only 4 fields in qaIssuePoReceipts. is it correct?

can you set breakpoint at aRefreshDataset.Open; line in TDABusinessProcessor.RefreshDeltaChange (uDABusinessProcessor.pas) and inspect properties of aRefreshDataset like SQL, Params, etc

There are only only three fields in the target table (qaIssuePoReceipts) and those are the only ones being updated.

You may teach me a new trick to get useful information. When I set the breakpoint and inspect, Here is what I see:

as I see from your screenshot, select was generated as

SELECT
    [],
    [],
FROM qaIssuePoReceipts
WHERE 
   [] = :PoNumber AND
   [] = :PartKey

so something could be wrong with mapping for this table.

Can you check mapping for this table as shown on this screenshot?

Here is the mapping. The PoNumber and Partkey thing do not make sense to me.


can you attach your schema here or send it to support@, pls?

Sent to Support via email

have you sent it to support@remobjects.com ?

Yes and just sent again. And uploaded here.KBonawitz.zip (108.1 KB)

settings of that table looks correct.
Do you have BusinessProcessor for this table in _Impl?

No business processors on this table

weird.
can you set breakpoint in

function TDABusinessProcessor.GenerateRefreshDataset(aDataset: TDADataset;
  aConnection: IDAConnection;
  const aTargetTable: String;
  aColumnMappings, AUnionMapping: TDAColumnMappingCollection): IDAServerDataset;

and see, why wrong mapping is used?

What is the intended process for determining what the refresh dataset is? The data change is successfully appended to the target table. What should the refresh dataset be?

refresh dataset is used for selecting data that can be returned to client at successful updating, like autoinc fields, server autorefresh fields, etc

you can specify poIgnoreRowsAffected in BP options so delta won’t be refreshed.
for autogenerated BP, it can be set via TDataAbstractService.OnBusinessProcessorAutoCreated event.

I set the requested break point per above. It appears that the processor is drilling down to joined tables which have autoincs and trying to return those values even though they are not part of the target table.

The target table has these columns:

Here is the breakpoint stuff showing the results of the GenerateRefreshDataSet Event:

The PartKey and PoNumber fields are autoincs, but they are joined tables and are not part of the updates. I do not think they should be evaluated as such if they are not part of the target table?

agree, but these fields are declared incorrectly in schema because they should have datInteger type instead of datAutoInc.

Thanks, logged as bugs://75525

I changed the datatypes to Integer for the two fields, and that did indeed allow the updates to succeed. Thanks for your excellent help as always. I truly appreciate it.

FWIW, I think to say that the field types are incorrectly set up as AutoInc may not be correct. The field types were automatically generated by the Schema Modeler and not adjusted manually, and In fact they do have Automatically Incremented values.

Delphi drivers can detect datAutoInc type only for AutoSQL statements and can’t for manual sql with joins so I think, they were set to datAutoInc by hand.