Virtabs Beispiel 9:  MODIFIES, CALCULATES

 

////////////////////////////////////////////////////////////////////
// Beispiel 9:
// Eine von DEPTS abgeleitete Virtab, die berechnete Viewspalten
// enthaelt.
// Es wird MODFIES, CALCULATES und WITHOUT demonstriert.

VIRTUALTABLE DEPTSINFO MODIFIES DEPTS
  COLUMN DEPT_PER_LOC CALCULATES // Unterabfrage!
   select count(*) from department
     where department.location_id = location.location_id
;

VIRTUALTABLE DEPTSINFO1 MODIFIES DEPTSINFO
  WITHOUT COLUMN DEPT_PER_LOC
  COLUMN LOC_PER_DEPT CALCULATES // Unterabfrage!
   1 / (select count(*) from department
         where department.location_id = location.location_id)
;
 

 

[Guided tour] [Bsp 1: Einfach] [Bsp 2: NOCHANGE] [Bsp 3: DEFAULT] [Bsp 4: INVISIBLE DEFAULT] [Bsp 5: CONSTRAINT] [Bsp 6: CONSTRAINT DEFLT] [Bsp 7: QUERY] [Bsp 8: Hierarchie] [Bsp 9: MODIFIES, CALCULATES]