MyDAC

TMyQuery.UpdatingTable Property

Used to specify which table in a query is assumed to be the target for subsequent data-modification queries as a result of user incentive to insert, update or delete records.

Class

TMyQuery

Syntax

property UpdatingTable: string;

Remarks

Use the UpdatingTable property to specify which table in a query is assumed to be the target for the subsequent data-modification queries as a result of user incentive to insert, update or delete records.

This property is used on Insert, Update, Delete or RefreshRecord (see also TCustomMyDataSet.Options) if appropriate SQL (SQLInsert, SQLUpdate or SQLDelete) is not provided.

If UpdatingTable is not set then the first table used in a query is assumed to be the target.

All fields from other than target table have their ReadOnly properties set to True (if TCustomMyDataSet.Options )

Example

The first example specifies a query in which only one value 'Dept' for the UpdatingTable property is allowed.

The second example shows a query in which allowed values for UpdatingTable are 'Dept' and 'Emp'.

By default the updating table will be the first used table, so 'DEPT' and all fields of DEPT will be editable. If however UpdatingTable is set to be 'EMP' all fields of EMP will be editable.

Example 1.
    SELECT * FROM Dept

Example 2.
   SELECT * FROM Dept, Emp
      WHERE Dept.DeptNo = Emp.DeptNo 
© 1997-2017 Devart. All Rights Reserved. Request Support DAC Forum Provide Feedback