update (dynamic command)

Description

Using a dynamic command, update changes data in existing rows of the referenced table.

Syntax

update [[database.]owner.]{table_name | view_name} 
set column_name1 = ? [, column_name2 = ?]...
[ where search_conditions...] ]

Parameters

set

specifies the column name and assigns the new value. The value passes as a parameter.

where

is a standard where clause.

search_conditions

sets the conditions for the rows that are retrieved. A search condition can include column names, constants, joins, the keywords is null, is not null, or, like, and, or any combination of these items.

Examples

Example 1

update authors 
 set au_lname = ?
 where au_id = ?

The au_lname column is set to the value of <parameter 1> (indicated by a “?”), where the value of au_id is equal to the value of <parameter 2> (indicated by the second “?”).

Usage