2.18.2 Example of overflow in an update value

Update in the stock control table (CONTROL), the total (TOTAL) column using the product of the unit price (PRICE) and the quantity (QUANTITY):

Organization of this subsection
(1) SQL
(2) Update results (with overflow error suppression feature specified)

(1) SQL

UPDATE CONTROL
  SET TOTAL = PRICE * QUANTITY

(2) Update results (with overflow error suppression feature specified)

[Figure]

If the overflow error suppression feature is not in effect, overflow occurs in the product of the unit price and the quantity (PRICE * QUANTITY) for the row with B-300 as the product code (PCODE). Processing is cancelled when the overflow occurs.

Even with the overflow error suppression feature in effect, overflow occurs for the row with B-300 as the product code (PCODE), but processing continues.

The result of an operation in which overflow occurs is the null value, so the total column (TOTAL) is updated with the null value. If a table is updated while the overflow error suppression feature is in effect, the table is updated with the null value. This fact should be taken into consideration when a table is to be updated.