Progress
SQL-89
Guide and Reference


Updating Rows

The searched UPDATE statement changes column values in one or more rows of a table. The searched UPDATE statement has the following syntax.

SYNTAX
UPDATE table-name
  SET column-name = { NULL | expression }
      [ , column-name = { NULL | expression } ] ...
  [ WHERE search-condition ] 

The SET clause evaluates the expression and assigns it to the column-name. The expression can be a column name, a literal, an arithmetic operation, a procedure variable or field name, or any combination of these.

The WHERE clause determines the rows to update. If you omit the WHERE clause, all rows of the target table are updated. See the "Specifying Search Conditions" section for details on the search conditions used in WHERE clauses.

The following example changes the zip code for customers in Jamaica Plain, Massachusetts.

UPDATE Customer SET Postal-Code = ’02130’
  WHERE City = ’Jamaica Plain’ AND State = ’MA’. 

See the "Positioned UPDATE" section for information on the positioned UPDATE statement.


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095