Show TOC

Example: UPDATE StatementLocate this document in the navigation structure

Use

In the ADDRESS table, the CITY column is defined as the primary key. A user has entered an UPDATE statement.

In an UPDATE statement, the database system searches for the data to be changed in the B* tree in the same way as for a SELECT statement.

  • If an UPDATE statement does not change the key value of the data record, the database system changes only the contents of the data record.

    If the length of the data record is changed in the process, the database system moves the subsequent data records on the leaf page accordingly and then updates the position list of the leaf page.

  • If the UPDATE statement does change the key field of the record, the database system executes the UPDATE as a DELETE with a subsequent INSERT.

More Information