Changes data in EntitySets, relationships, forms, or sets.
UPDATE [ALL] [SQLsetspec] SET Â«field = value Â»
[WHERE clause [EVALUATE clause] [-> clause]
|ALL||Optional. Regardless of whether ALL is entered, all records in the set specification that meet the specified condition (if any) are updated.|
|SQLsetspec||An SQL set specification. Can contain application documents, EntitySets, relationships, forms, and sets. Role names are permitted.
If SQLsetspec is omitted, the current set is used (if it exists). Application documents named in the SQLsetspec may not be updated.
|field||A target field in SQLsetspec.|
Any value expression.
The keyword NULL.
Field is assigned either the value of the expression, or the $Null property, as specified.
Any number of field = value assignments may be entered. If a field is not explicitly specified for update, its value remains unchanged.
The function of the UPDATE command is similar to that of the CHANGE command. UPDATE is able to update more than one database file in one command.
update Employees set Salary = Salary * 1.1
change all Employees let Salary = Salary * 1.1
The preceding two commands are equivalent. Notice that, although the ALL has been omitted from the UPDATE command, it nevertheless updates all records that conform to the set specification.
update Employees, Departments
set Employees.Salary = Departments.StdSalary
where Employees.DNo = Departments.DNo
In the preceding command, the join condition appears in the WHERE clause. Notice that no relationship is needed.