This code snip explains how to update the coupon field of
more than one table, using data from a coupon table using "for update
of" cursor. The condition is that:
1. No coupon can be used more than once from coupon table.
2. Coupons being valuable entity should not be tampered by
any DML operation during merging into target table.
This scenario occurs when we are given with some coupon
codes stored in a coupon table. The records from this table will be used to
update certain tables one after the other. So the coupon table maintains a flag
showing which coupons have already been used once and uses only those records,
which are not yet been used.
For safety reasons the coupon field in person_table_1 are
locked through explicit locking by "for update of" clause to deny
access for the duration of a tractions.