Changing Data Using Update - Sybase Adaptive Server IQ 12.4.2 Administration And Performance Manual

Table of Contents

Advertisement

Changing data using UPDATE

Changing data using UPDATE
UPDATE syntax
224
The Append_Load option applies to
statements.
INSERT...VALUES
For more information on versioning see Chapter 8, "Transactions and
Versioning".
You can use the
UPDATE
to change single rows, groups of rows, or all rows in a table. As in all data
modification statements, you can change the data in only one table or view at
a time.
The
statement specifies the row or rows you want changed and the
UPDATE
new data. The new data can be a constant or an expression that you specify or
data pulled from other tables.
If an
statement violates an integrity constraint, the update does not
UPDATE
take place and an error message appears. For example, if one of the values
being added is the wrong data type, or if it violates a constraint defined for one
of the columns or data types involved, the update does not take place.
See the Adaptive Server IQ Reference Manual for complete
simplified version of the syntax is:
UPDATE table-name
SET column_name = expression
WHERE search-condition
If the company Newton Ent. (in the customer table of the sample database) is
taken over by Einstein, Inc., you can update the name of the company using a
statement such as the following:
UPDATE customer
SET company_name = 'Einstein, Inc.'
WHERE company_name = 'Newton Ent.'
You can use any condition in the WHERE clause. If you are not sure how the
company name was entered, you could try updating any company called
Newton, with a statement such as the following:
UPDATE customer
SET company_name = 'Einstein, Inc.'
WHERE company_name LIKE 'Newton%'
,
LOAD
INSERT...SELECT
statement, followed by the name of the table or view,
, and
syntax. A
UPDATE

Advertisement

Table of Contents
loading

Table of Contents