Within a trigger definition, you can refer to columns of the row being inserted, updated, or deleted. This enables you to examine column values, or to change values before they are used for an insert or update. To refer to a given column, prefix the column name with a qualifier of OLD to refer to a value from the original row or NEW to refer to a value in the new row. OLD and NEW must be used appropriately, because the triggering event determines which of them are allowable:
OLD must be used in read-only fashion. NEW can be used to read or change column values. The Capital_bi and Capital_bu TRiggers shown earlier in the chapter demonstrate the use of OLD and NEW. |