ALLBASE/SQL Reference Manual (36216-90216)

580 Chapter12
SQL Statements S - Z
UPDATE
UPDATE
The UPDATE statement updates the values of one or more columns in all rows of a table or
in rows that satisfy a search condition.
Scope
ISQL or Application Programs
SQL Syntax
UPDATE {[
Owner.
]
TableName
[
Owner.
]
ViewName
)
SET {
ColumnName
= {
Expression
‘LongColumnIOString’
NULL } } [,...]
[WHERE
SearchCondition
]
Parameters
[
Owner
.]
TableName
specifies the table to be updated.
[
Owner
.]
ViewName
specifies a view; the table on which the view is based is updated.
Refer to the CREATE VIEW statement for restrictions governing updates
via views.
ColumnName
designates a column to be updated. You can update several columns of the
same table with a single UPDATE statement.
Expression
is any expression that does not contain an aggregate function or a LONG
column (except via the long column function). The expression is evaluated
for each row qualifying for the update operation. The data type of the
expression must be compatible with the column's data type.
'
LongColumnIOString
' specifies the input and output locations for the LONG data. The
syntax for this string is presented in a separate section below.
NULL puts a null value in the specified column of each row satisfying the
WHERE clause. The column must allow null values.
SearchCondition
specifies a search condition; the search condition cannot contain an
aggregate function. All rows for which the search condition is true are
updated as specified in the SET clause. Rows that do not satisfy the search
condition are not affected. If no rows satisfy the search condition, the table
is not changed.
Description
If the WHERE clause is omitted, all rows of the table are updated as specified by the
SET clause.
If the WHERE clause is present, then the search condition is evaluated for each row of