Table of Contents
update -- replace values of attributes in a class
update
classname set attname-1 = expression-1
[, attname-i = expression-i]
[from
from-list]
[where qual]
Update changes the values of the
attributes specified for all instances which satisfy the qualification,
qual. Only the attributes to be modified need appear as atributes.
Array
references use the same syntax found in select(l)
. That is, either single
array elements, a range of array elements or the entire array may be replaced
with a single query. from-list is a non-standard extension to allow columns
from other tables to appear in the target_list.
You must have write access
to the class in order to modify it, as well as read access to any class
whose values are mentioned in the target list or qualification.
--
--Give all employees who work for Smith a 10% raise
--
update emp
set sal = 1.1 * sal
where mgr = 'Smith'
create table(l)
,
select(l)
.
Table of Contents