Contents Index Adding rows to a table Deleting rows

ASA Getting Started
  Updating the Database

Modifying rows in a table


In most databases, you need to update records that are already stored in the database. For example, the manager ID should change when employees are transferred between departments, as well as the department ID.

Transfer employee #195 to department 400 in Interactive SQL

Since Adaptive Server Anywhere updates all rows that satisfy the conditions of the WHERE clause, sometimes more than one row is updated at one time. For example, if a group of sales employees are transferred into marketing and have their dept_id column updated, the following statement sets the manager_id for all employees in the marketing department to 1576.

UPDATE employee
SET manager_id = 1576
WHERE dept_id = 400

For employees already in the marketing department, no change is made.

You can also modify rows from the result set in Interactive SQL.

For more information, see Editing table values in Interactive SQL.


Contents Index Adding rows to a table Deleting rows