UpdateMode/providersflag

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Japhar
Posts: 38
Joined: Thu 05 Oct 2006 04:22

UpdateMode/providersflag

Post by Japhar » Wed 14 Feb 2007 14:09

Hi,

We are migrating IDAC componets to SDAC.

I just want to explain the existing functionality of UpdateMode property of TQuery in Informix Data Access Component.

UpdateMode to specify the criteria for locating a record in the dataset when applying updates.

Options of Update Mode: (upWhereAll, upWhereChanged, upWhereKeyOnly)

Value Meaning
---------------------------------------------
upWhereAll : All columns (fields) are used to locate the record.
upWhereChanged: Only key field values and the original value of fields that have changed are used to find the record.
upWhereKeyOnly: Only key fields are used to find the record.

In SDAC we doesn't have UpdateMode property for the TMSQuery. We have provider flags property for the persistency fields.

Questions:
1. Provier flags we can set only for the persistency fields. So if we set 'pfInWhere' for one of the field then this means that this field is used to locate the record in DataSet when we say apply updates?

Example: I'm selecting 3 columns in a simple select query

select c1, c2, c3 from xyz where c4=:c4

Now, if i set c1=pfInWhere and c2,c3 i have not set any value then
How it locate record in a DataSet when i say Apply Updates?

2. 'pfInWhere' is simliar to the 'upWhereChanged' of IDAC component?

Can you please provide more details on this topic, which will help me to understand the funtionality much better..

Thanks in advance...

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Thu 15 Feb 2007 09:32

SDAC does not use the provider flags to generate update queries, it just fills them from information taken from the server. SDAC uses its internal information about key fields. By default the only key fields are used to apply record changes. If you want to control changes made by other users, you should use the CheckRowVersion option. You can read more about this option in SDAC Help documentation.
You can also assign a query template to the SQLUpdate property to be used when applying changes.

Post Reply