| Two items here:
1) Fetching next/prior and unique row numbers:
--- WARNING! WARNING! VERY NON-ANSI STANDARD ACTIVITY! ---
DB2 does not provide a FETCH PRIOR capability, but they can
simulate it with temporary tables. If your application would
like to be able to browse through a set of rows, IBM recommends
that you select the set of rows and put them in a temporary table.
Rows within a temporary table are assigned a unique row number, so
therefore you can easily browse through the set.
2) Locking granularity
DB2 does offer higher levels of granularity for locking. They support
consistency level 2 or "cursor stability" concurrency transactions, or
consistency level 3 or "repeatable read" consistency transactions.
Consistency level 2 (also known as "dirty reads") does not guarantee
that the record you are looking at will be the same the next time you
fetch it. Some applications (such as telephone directory assistance)
can manage using level 2. Other applications (such as order-entry or
inventory control) require level 3. A single transaction must operate
at the same consistency level for the duration of the transaction.
|