Recent

Author Topic: UpWhereChanged and ProviderFlags=[pfInWhere]  (Read 1987 times)

Ign_17

  • New Member
  • *
  • Posts: 43
UpWhereChanged and ProviderFlags=[pfInWhere]
« on: August 01, 2017, 10:07:56 am »
Hi everybody,

I´m a bit confused about the property "UpdateMode = UpWhereChanged" and the "pfInWhere" value in ProviderFlags property.
As i´ve unsderstood, just especyfing "UpWhereChanged", automatically the fields to modify on a update operation are included in the WHERE clause of a UPDATE command.

On the other hand, Providerflags=[pfInWhere] specify whether a specific field is incluyed or not in the WHERE clause of an UPDATE command. 
It seems both options plays the same or a similar role, specifying what fields will appear in the Where clause of an update operation.

Please, can anyone explain me what is the difference, and how these two properties ( UpWhereChnged and TproviderFlags.pfInWhere) are related one with the other?

Thanks in advance

LacaK

  • Hero Member
  • *****
  • Posts: 691
Re: UpWhereChanged and ProviderFlags=[pfInWhere]
« Reply #1 on: August 01, 2017, 03:09:38 pm »
upWhereChanged is specified at TSQLQuery level. It says, that TSQLQuery updates should be constructed into SQL where WHERE part consists of fields, which are locally changed + always fields which are part of primary key.

pfInWhere is specified at TField level. So this give you additional possibility include/exclude individual fields.

So if field is part of primary key then it is always also part of SQL WHERE clause.
Next if UpdateMode=upWhereChanged AND field is changed then if Fields ProviderFlag has pfInWhere (default) then this field is added to where clause in other cases is not added.

Ign_17

  • New Member
  • *
  • Posts: 43
Re: UpWhereChanged and ProviderFlags=[pfInWhere]
« Reply #2 on: August 01, 2017, 07:53:45 pm »
Perfectly clear,
thank you very much for your explanation.

Regards,

 

TinyPortal © 2005-2018