Tuples

Triggers in SQL

The SQL trigger statement gives the user a number of different options in the event, condition, and action parts. Here are the principal features. 1. The action may be executed either before or after the triggering event. 2. The action can refer to both old and/or new values of tuples that were inserted, deleted, or updated in the event that triggered the action.

Cursors

The most handy way to connect SQL queries to a host language is with a cursor that runs through the tuples of a relation. This relation can be a stored table, or it can be something that is created by a query. To create and use a cursor, we need the following statements: 1. A cursor declaration. The simplest form of a cursor declaration consists of:

Modifications by Cursor

When a cursor ranges over the tuples of a base table (i.e., a relation that is stored in the database, rather than a view or a relation constructed by a query), then one can not only read and process the value of each tuple, but one can update or delete tuples. The syntax of

Protecting Against Concurrent Updates

Assume that as we observe the net worths of movie executives using the function worthRanges of Cursors Figure 1, some other process is modifying the underlying MovieExec relation. We shall have more to say about a number of processes accessing a single database at the

Scrolling Cursors

Cursors give us a choice of how we move through the tuples of the relation. The default, and most common choice is to start at the beginning and fetch the tuples in order, until the end. On the other hand, there are other orders in which tuples may be fetched, and tuples could be

Page 7 of 7 Previous 1 2 3 4 5 6 7 Next