Progress
SQL-89
Guide and Reference


UPDATE Statement

Changes values in one or more rows of a table.

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

table-name

Represents the name of the table in which to update rows.

SET column-name = { NULL | expression } ] , column-name = { NULL | expression } ] ...

Assigns new values to each column named. The column-name can be qualified with a table name or a database name and table name. Each expression has the following syntax.

SYNTAX
    value-expression [ INDICATOR ] variable 
      [ [ expression [ FOR n ] ] ] 

The value-expression can involve a literal, column name, arithmetic operation, a defined Progress variable or field name, or any combination of these. Each indicator variable must be an integer. You can set a column to the NULL value by setting the indicator variable to -1. Otherwise, set the indicator variable to 0. You can use an indicator variable with an expression, but not with the literal NULL.

WHERE search-condition

Identifies the conditions under which the rows are updated. The search condition compares the values in one column to the values in another column or to a literal. If you omit the WHERE clause, all rows of the target table are updated. For more detailed information about WHERE clause search conditions, see Data Manipulation Language."

WHERE CURRENT OF cursor-name

Identifies the cursor that points to the row to be updated (positioned update).

EXAMPLE

UPDATE Item           
  SET Price = Price * 1.25
  WHERE Item-Num = 52. 

NOTE

SEE ALSO

CLOSE Statement, DECLARE CURSOR Statement, DELETE FROM Statement, FETCH Statement, INSERT INTO Statement, OPEN Statement, SELECT Statement, UNION Statement, UPDATE Statement


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