Changing data using UPDATE
224
The Append_Load option applies to
LOAD
,
INSERT...SELECT
, and
INSERT...VALUES
statements.
For more information on versioning see Chapter 8, “Transactions and
Versioning”.
Changing data using UPDATE
You can use the
UPDATE
statement, followed by the name of the table or view,
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
UPDATE
statement specifies the row or rows you want changed and the
new data. The new data can be a constant or an expression that you specify or
data pulled from other tables.
If an
UPDATE
statement violates an integrity constraint, the update does not
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.
UPDATE syntax
See the Adaptive Server IQ Reference Manual for complete
UPDATE
syntax. A
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%’
Summary of Contents for Adaptive Server IQ 12.4.2
Page 1: ...Administration and Performance Guide Adaptive Server IQ 12 4 2 ...
Page 16: ...xvi ...
Page 20: ...Related documents xx ...
Page 40: ...Compatibility with earlier versions 20 ...
Page 118: ...Troubleshooting startup shutdown and connections 98 ...
Page 248: ...Importing data by replication 228 ...
Page 306: ...Integrity rules in the system tables 286 ...
Page 334: ...Cursors in transactions 314 ...
Page 396: ...Users and permissions in the system tables 376 ...
Page 438: ...Determining your data backup and recovery strategy 418 ...
Page 484: ...Network performance 464 ...
Page 500: ...System utilities to monitor CPU use 480 ...
Page 514: ...Characteristics of Open Client and jConnect connections 494 ...
Page 536: ...Index 516 ...