UPDATE
Purpose
Using the UPDATE the statement, you can make targeted changes to the contents of the table.
Prerequisites
- You need to have the system privilege UPDATE ANY TABLE, object privilege UPDATE on the table or its schema, or the table belongs to the current user or one of the user roles.
- You need to have the appropriate SELECT privileges on the schema object referenced in the optional FROM clause.
Syntax
update::=
Usage Notes
- By using the FROM clause, you can define several tables which are joined through the WHERE clause. By that, you can specify complex update conditions which are similar to complex SELECT statements. The updated table must be specified from within the FROM clause.
- If a column is set to the value DEFAULT, then the rows in this column affected by the UPDATE are filled automatically. For identity columns, a monotonically increasing number is generated, and for columns, with default values their respective default value is used. For all other columns, the value NULL is used.
- For information on default values, refer to Default Values section. For information on identity columns, refer to the Default Values section.
- The PREFERRING clause defines a Skyline preference term. For more information, refer to the Skyline section.
Internally this statement is transformed into a MERGE statement. Therefore, error messages can refer to the MERGE command. If one row is updated multiple times, the new value must be identical. Otherwise, the error message "Unable to get a stable set of rows in the source tables" will be displayed.