In this recipe, we will see how to use virtual columns, a new feature in Oracle Database 11g, to avoid the use of DML triggers, resulting in a performance gain in our applications.
Virtual columns can also be used in referential integrity, tables can be partitioned by them, and statistics can be gathered on them.
The following steps will demonstrate the use of virtual columns:
CREATE TABLE sh.LOANS ( LOAN_ID INT NOT NULL, PAYMENT NUMBER, NUMBER_PAYMENTS NUMBER, GROSS_CAPITAL NUMBER);
LOANStable to calculate the
GROSS_CAPITALfield, giving the number of payments and the amount of every single ...