Purpose (or side effects) of the TDADataTable.Params

What do these parameters do for derived classes TDACDSDataTable and TDAMemDataTable?
Is there a difference in the implementation?

At present we use DataRequestCall.ParamByName(‘Parameters’).Value to set parameters before an Open

Does DATable.Params affect the open (remote load) ? Does it affect the dataset after it has been fetched?

Hi,

TDAParamCollection are declared and used on the ancestor level (i.e. in the TDADataTable class) so DAD processes this object in the same way for descendants (MEM and CDS tables).

DAD passes this collection to server-side so server-side uses these parameters for filtering data received from database.

simple example:

  • create any SELECT with parameter like select * from mytable where field1 = :field1
  • create this table with RDA on client-side
  • use this code for opening:
mytable1.ParamByName('field1').Value := ...;
mytable1.Open;

it will do the same as you done with DataRequestCall.ParamByName(‘Parameters’).Value, but above code is more simplified.

Thanks for the info

In some historic code I saw this
FBestellingStock.Params.ParamByName(‘Bestelling’).AsInteger := BestellingPK; // do not localize
FBestellingStock.Params.ParamByName(‘Leverancier’).AsInteger := Leverancier; // do not localize
lParams := TXLSParams.Create;
lParams.Clear;
for i := 0 to FBestellingStock.Params.Count - 1 do
lParams.AddParam(FBestellingStock.Params.Params[i]);
FBestellingStock.DataRequestCall.ParamByName(‘Parameters’).Value := lParams.Text; // do not localize
FBestellingStock.Open;

which was the reason I asked the question.
So this is completely redundant, correct?

Do the Params do anything after the open? In particular when the dataset changes?
Filter or sort the dataset somehow?
I don’t expect it to but I am trying to explain behaviour difference in TDACDSDataTable and TDAMemDataTable.

Hi,

you are using DA3 style that was actual is about 16+ years ago when one RDA could handle one table.
nowadays, one RDA can handle several tables and DA3 behavior can be considered as outdated.

Params are used before opening table only - they are sent to server-side for filtration of data in SQL request.