Updates to records in tables

Use the update keyword to update an existing record in a table.

Syntax

The following syntax shows how to use the update keyword.

update                     database_name.table_name
set                     column = value
                    [ , column = value ... ]
[ where conditional_test ] ;

If the update statement is used without a where condition, all records are updated.

Example

The following example updates the Age column of the staff.managers table for any records where Name="John".

|phoenix:1.> update staff.managers 
|phoenix:2.> set Age=27
|phoenix:3.> where Name="John";
|phoenix:4.> go

The following topics provide additional examples of the update statement.