next up previous contents
Next: Examples. Up: The OPM Query Previous: Examples.

Update Queries

 

The attribute values of an instance can be modified using UPDATE statements. An UPDATE statement involves non-derived local and inherited attributes associated with a target class, and can be associated with a WHERE statement involving this class. Again, the target class is represented by one variable, but the condition expressed using variables may involve more than one class.

<UPDATE query> ::= UPDATE <simple variable> '(' <attribute updates> ')' 
                   <from statement> <optional where statement> ';'
                 ;

<attribute updates> ::= <attribute update>
                      | <attribute updates> ',' <attribute update>
                      ;

<attribute update> ::= <attribute insert statement>
                     | <attribute modify statement>
                     ;

<attribute insert statement> ::= ADD <assign attribute values>
                               ;

<attribute modify statement> ::= SET <assign attribute values>
                               ;