Updating database with sql statement

Consider a hotel database: bookings for the hotel rooms are recorded in the table named BOOKINGS. The after-update row trigger fires for every row, and some bookings are changed in bulk, updating hundreds of rows in one transaction.

You also want to record the changes to this table to a tracking table—sort of like auditing, but with a twist: You want to make it transactional. You come up with a small after-update row trigger that records the old and new values along with who changed it into a table BOOKINGS_HIST. Separate after-update-row triggers fire for each of these rows and each execution inserts a record into the bookings_hist table, so performance is not optimal.

(For an example of this scenario, see Walkthrough: Using a Data Grid Web Control to Read and Write Data.) Alternatively, you can update the database directly, using SQL statements or stored procedures, which is what this walkthrough illustrates.

Syntax update statement ::= Description of the illustration update_Keyword and Parameter Description alias Another (usually short) name for the referenced table or view, typically used in the contains references to columns in the table being updated, the references are resolved in the context of the current row.

The old column values are used on the right side of the equal sign.

As you proceed, remember that updating data is not the same process as entering new data.

For information about entering new data in a database, see the article Add one or more records to a database.

Leave a Reply

Your email address will not be published. Required fields are marked *

One thought on “updating database with sql statement”

  1. But when John learns of what Maria is advocating and that Freder has joined their cause, with the assistance of an old colleague. In Oct of 1984 the world premiere of Digital sound in a motion picture theatre took place, using Moroder's digitally recorded version of Metropolis.