CHAPTER 6 Controlling Updates in DataWindow Objects
DataWindow Designer User’s Guide 197
This statement will succeed regardless of whether other users have
modified the row since your application retrieved the row. For example, if
another user had modified the salary to $70,000, that change will be
overwritten when your application updates the database.
• If you choose Key and Modified Columns for the
WHERE clause, the
UPDATE statement looks like this:
UPDATE Employee
SET Salary = 65000
WHERE Emp_ID = 1001
AND Salary = 50000
Here the UPDATE statement is also checking the original value of the
modified column in the
WHERE clause. The statement will fail if another
user changed the salary of employee 1001 since your application retrieved
the row.
• If you choose Key and Updatable Columns for the
WHERE clause, the
UPDATE statement looks like this:
UPDATE Employee
SET Salary = 65000
WHERE Emp_ID = 1001
AND Salary = 50000
AND Emp_Fname = original_value
AND Emp_Lname = original_value
AND Status = original_value
...
Here the UPDATE statement is checking all updatable columns in the
WHERE clause. This statement will fail if any of the updatable columns for
employee 1001 have been changed since your application retrieved the
row.
Specifying update when key is modified
The Key Modification property determines the SQL statements DataWindow
Designer generates whenever a key column—a column you specified in the
Unique Key Columns box—is changed. The options are:
•Use
DELETE then INSERT (default)
•Use
UPDATE