provider catastrophic failure

LRGood

Member
I get a catastrophic failure from the line of code identified by ==> in the method below. The method is in Delphi's provider unit.

the SQL is in a package and shown below:

begin
cwb_recipe.level_info(serieskey => :serieskey,
leveldetails => :leveldetails );
end;

The SQL returns 8 fields where the first 5 are from the target table and the last three are from joins on other tables. I have changed provider flag options in the "non-target fields". I also have changed the updatemode in the provider. No luck.

procedure TCustomResolver.InitKeyFields(Tree: TUpdateTree; ADelta: TPacketDataSet);
var
Pos, i: Integer;
KeyFields, FieldName: string;
begin
==> KeyFields := IProviderSupport(Tree.Source).PSGetKeyFields;
Pos := 1;
while Pos
 
Have you set the TOracleDataSet.UniqueFields property, the TOracleDataSet.UpdatingTable property, or the pfInKey flags of the dataset field? If not, the dataset cannot determine the key fields for this package call.

------------------
Marco Kalter
Allround Automations
 
I had tried a lot of variations but never specified the Unique Fields. I apparently miss understood when they should be specified. Thanks

OBTW: I would like to be able to change 2 of the non-updateable fields in resultant dataset for informational purposes only. CanModify always appears to be true and thus I cannot change them. Is there any way to curcumvent this?
 
I'm not sure I understand the question. If you meant to say that CanModify is False, then you may need to include the rowid in the result set.

------------------
Marco Kalter
Allround Automations
 
Hi Marco, I have similar problem. I have ODS connected to ClientDataSet via provider. The SQL contains stored procedure and insert/update/delete is maintained via provider BeforeUpdareRecord with stored procedures.
Unfortunatelly I have to load fields into ODS or set ODS.UniqueFields property.
Without this it crash with Access Violation on mentioned raw. Why the TOracleDataSet need the unique key information (everything is managed with stored procedures). I think that there is something wrong - if ODS cannot determine the key fields is should returns empty string (as db.pas) instead of raising an access violation ....

DOA 4.1.2.0 - Delphi 2010

Regards V.

Marco Kalter said:
Have you set the TOracleDataSet.UniqueFields property, the TOracleDataSet.UpdatingTable property, or the pfInKey flags of the dataset field? If not, the dataset cannot determine the key fields for this package call.

------------------
Marco Kalter
Allround Automations
 
I'm not sure where and how the crash occurs, but for an updatable result set the fields that uniquely identify a record must be known.
 
Sorry this is not true for a case when stored procedures are used for the update / edit. In this case the OracleDataSet doesn't have to have these information.

The bug is probably somewhere in PSGetKeyFields (as shown above)

Thank you! Your product is great! (except these small bugs)
 
Back
Top