Progress
SQL-92
Guide and Reference


UPDATE Statement

Updates the rows and columns of the specified table with the given values for rows that satisfy the search_condition. This is the syntax for the UPDATE statement:

SYNTAX

UPDATE table_name 
  SET assignment [, assignment ] , ... 
  [ WHERE search_condition ] ; 

assignment:

SYNTAX
column = { expr | NULL } 
  | ( column [, column ] , ... ) = ( expr [, expr ] ) 
  | ( column [, column ] , ... ) = ( query_expression ) 

NOTES

EXAMPLES

UPDATE orders 
          SET qty = 12000 
          WHERE order_no = 1001 ; 
  
  
UPDATE orders 
          SET (product) = 
                    (SELECT item_name 
                     FROM items 
                     WHERE item_no = 2401 ) 
          WHERE order_no = 1002 ; 
  
  
UPDATE orders 
          SET (amount) = (2000 * 30) 
          WHERE order_no = 1004 ; 
  
  
UPDATE orders 
          SET (product, amount) =  
                              (SELECT item_name, price * 30 
                               FROM items 
                               WHERE item_no = 2401 )  
          WHERE order_no = 1002 ; 

AUTHORIZATION

Must have DBA privilege or UPDATE privileges on all the specified columns of the target table, and SELECT privilege on all the other tables referred to in the statement.

SQL COMPLIANCE

SQL-92. ODBC Extended SQL grammar. Progress Extensions: assignments of the form
( column , column , ... ) = ( expr , expr , ... )

ENVIRONMENT

Embedded SQL, interactive SQL, ODBC applications, JDBC applications

RELATED STATEMENTS

SELECT Statement, OPEN Statement, FETCH Statement, "Search Conditions" and "Query Expressions" in "SQL-92 Language Elements"


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