UPDATE

UPDATE

Welcome to our Knowledge Base

Documentation | Blog | Demos | Support

< All Topics
Print

UPDATE

Changes data in EntitySets, relationships, forms, or sets.

Syntax

UPDATE [ALL] [SQLsetspec] SET «field = value »
[WHERE clause [EVALUATE clause] [-> clause]

Parameters

ALLOptional. Regardless of whether ALL is entered, all records in the set specification that meet the specified condition (if any) are updated.
SQLsetspecAn 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.
fieldA target field in SQLsetspec.
valueCan be:
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.

Comments

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.

Example

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.

See Also

ADD

CHANGE

Conventions

Was this article helpful?
0 out of 5 stars
5 Stars 0%
4 Stars 0%
3 Stars 0%
2 Stars 0%
1 Stars 0%
5
How can we improve this article?
Please submit the reason for your vote so that we can improve the article.

Leave a Reply

Your email address will not be published. Required fields are marked *

en_CAEnglish