Creating SET clauses in UPDATE statements in the SQL Query Builder

After you add a table to an UPDATE statement in the SQL Query Builder, you can create a SET clause. The SET clause specifies the columns to update and the new values for the columns.

Before you begin

You can add individual columns and groups of columns to the SET clause. In a group, you can provide values for individual columns or for the entire group of columns. You can specify a subquery to provide values for a group of one or more columns.

The default value that is shown for each column depends on how the column was defined when the table was created.

  • If the column was defined with a default value, the cell value is DEFAULT. In the Design pane, manually specify the value in the Expression column.
Before creating SET clauses, ensure that the following requirements are met:
  • The UPDATE statement must be open in the SQL Query Builder.
  • The UPDATE statement must contain a table specification.

Procedure

To create a SET clause:

  1. In the Design pane of the SQL Query Builder, click the Set tab.
  2. Add columns to the SET clause individually or as a group:
    • To add columns individually, click a column in the list and then click Add.
    • To add columns as a group, select multiple columns and then click group.
  3. Specify values for one or more columns. In the row that contains the column or group of columns, double-click the cell under the Expression heading. Type a value or expression, or use the Expression Builder wizard to specify a more complex expression.




© Copyright IBM Corporation 2010, 2017.