Changes data in existing rows, either by adding data or by modifying existing data. Use this as a language command.
update [[database.]owner.]{table_name | view_name} set [[[database.]owner.]{table_name.|view_name.}] column_name1 = {expression1|NULL|(select_statement)} [column_name2 = {expression2|NULL|(select_statement)}]... [,[[database.]owner.]{table_name|view_name}]...] [where search_conditions]
specifies the column name and assigns the new value. The value can be an expression or a null. When more than one column name and value pair are listed, they must be separated by commas.
is a standard where clause.
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.
update authors set au_lname = “MacBadden” where au_lname = “McBadden”
You can include a from clause in the update statement, but because DB2 does not support it, the DB2 access service ignores it.
You cannot update views defined with the distinct clause. However, when the view is created, the select language command allows the term distinct to be used with it. For more information, see the Sybase SQL Server Reference Manual.
Copyright © 2005. Sybase Inc. All rights reserved. |