I have a query, that selects one table and does not contain all PK columns of the selected table (as I don't need them selected). all selected fields are made persistent in delphi ide.
After opening the query, the property "fielddefs" contains more items than the property "fields" and I can see, the fielddefs contain also the missing PK column, that I did not select and don't need.
Why is this happening? It makes big trouble, if the dataset is used in datasnap server (EArgumentOfOfRangeException in function TDBXDataSetTable.GetColumns), as there is following code
Code: Select all
SetLength(FValueTypes, FTable.FieldDefs.Count);
for Ordinal := Low(FValueTypes) to High(FValueTypes) do
begin
FieldDef := FTable.FieldDefs[Ordinal];
Field := FTable.Fields[Ordinal];
Why is SDAC adding this nonselected PK column to fielddefs?! Can I avoid this somehow? It's really annoying to add all PK fields of all joined tables (nr, nr_1, nr_2 etc), when the query is more complicated
Or, do you think, is it a bug in the delphi sources?
Thanks, Ludek.